Spaces:
Sleeping
Sleeping
Upshivam commited on
Commit ·
9e109e0
1
Parent(s): 5e0018c
Fix: use Qwen2.5-72B-Instruct - confirmed working model
Browse files
app.py
CHANGED
|
@@ -3,19 +3,20 @@ import os
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
client = InferenceClient(
|
| 6 |
-
model="
|
| 7 |
token=os.environ.get("HF_TOKEN")
|
| 8 |
)
|
| 9 |
|
| 10 |
def generate_dockerfile(description, base_os, app_type):
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
Description: {description}
|
| 20 |
Base OS: {base_os}
|
| 21 |
App Type: {app_type}
|
|
@@ -25,11 +26,8 @@ Include:
|
|
| 25 |
- Non-root user for security
|
| 26 |
- Health check
|
| 27 |
- Clear comments"""
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
response = client.chat_completion(
|
| 32 |
-
messages=messages,
|
| 33 |
max_tokens=800,
|
| 34 |
temperature=0.3
|
| 35 |
)
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
client = InferenceClient(
|
| 6 |
+
model="Qwen/Qwen2.5-72B-Instruct",
|
| 7 |
token=os.environ.get("HF_TOKEN")
|
| 8 |
)
|
| 9 |
|
| 10 |
def generate_dockerfile(description, base_os, app_type):
|
| 11 |
+
response = client.chat_completion(
|
| 12 |
+
messages=[
|
| 13 |
+
{
|
| 14 |
+
"role": "system",
|
| 15 |
+
"content": "You are a DevOps expert. Return ONLY Dockerfile content, no explanation, no markdown backticks."
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"role": "user",
|
| 19 |
+
"content": f"""Generate a production-ready Dockerfile for:
|
| 20 |
Description: {description}
|
| 21 |
Base OS: {base_os}
|
| 22 |
App Type: {app_type}
|
|
|
|
| 26 |
- Non-root user for security
|
| 27 |
- Health check
|
| 28 |
- Clear comments"""
|
| 29 |
+
}
|
| 30 |
+
],
|
|
|
|
|
|
|
|
|
|
| 31 |
max_tokens=800,
|
| 32 |
temperature=0.3
|
| 33 |
)
|