Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,16 @@ def generate_response(user_input):
|
|
| 19 |
# 1️⃣ Определение модели
|
| 20 |
prefs = analyze_user_input(user_input)
|
| 21 |
model_id = choose_model(user_input)
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# 2️⃣ Запрос к модели
|
| 25 |
payload = {"inputs": user_input, "parameters": {"max_new_tokens": 600, "temperature": 0.7}}
|
|
|
|
| 19 |
# 1️⃣ Определение модели
|
| 20 |
prefs = analyze_user_input(user_input)
|
| 21 |
model_id = choose_model(user_input)
|
| 22 |
+
api_url = "https://router.huggingface.co"
|
| 23 |
+
|
| 24 |
+
payload = {
|
| 25 |
+
"model": model_id, # теперь модель указывается здесь!
|
| 26 |
+
"inputs": user_input,
|
| 27 |
+
"parameters": {"max_new_tokens": 600, "temperature": 0.7}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
response = requests.post(api_url, headers=HEADERS, json=payload)
|
| 31 |
+
|
| 32 |
|
| 33 |
# 2️⃣ Запрос к модели
|
| 34 |
payload = {"inputs": user_input, "parameters": {"max_new_tokens": 600, "temperature": 0.7}}
|