Yermek68 commited on
Commit
8057dd0
·
verified ·
1 Parent(s): c706825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
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
- api_url = f"https://router.huggingface.co/{model_id}"
 
 
 
 
 
 
 
 
 
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}}