Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,8 @@ import os
|
|
| 5 |
from groq import Groq
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
#
|
| 10 |
api_key = os.getenv("GROQ_API_KEY", "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")
|
| 11 |
client = Groq(api_key=api_key)
|
| 12 |
|
|
@@ -65,11 +65,13 @@ def feifeichat(image):
|
|
| 65 |
}
|
| 66 |
]
|
| 67 |
|
| 68 |
-
#
|
| 69 |
response = client.chat.completions.create(
|
| 70 |
-
model="
|
| 71 |
messages=messages,
|
| 72 |
response_format={"type": "json_object"},
|
|
|
|
|
|
|
| 73 |
stream=True
|
| 74 |
)
|
| 75 |
|
|
|
|
| 5 |
from groq import Groq
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
+
# Read the key name from Hugging Face Environment Variables secrets configuration
|
| 9 |
+
# Ensure "GROQ_API_KEY" is set in your Hugging Face Space settings.
|
| 10 |
api_key = os.getenv("GROQ_API_KEY", "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")
|
| 11 |
client = Groq(api_key=api_key)
|
| 12 |
|
|
|
|
| 65 |
}
|
| 66 |
]
|
| 67 |
|
| 68 |
+
# Updated model to Qwen 3.6 27B and added reasoning_effort="none" for fast, non-thinking JSON output
|
| 69 |
response = client.chat.completions.create(
|
| 70 |
+
model="qwen/qwen3.6-27b",
|
| 71 |
messages=messages,
|
| 72 |
response_format={"type": "json_object"},
|
| 73 |
+
reasoning_effort="none",
|
| 74 |
+
temperature=0.7,
|
| 75 |
stream=True
|
| 76 |
)
|
| 77 |
|