quentinbch commited on
Commit
17036d1
·
verified ·
1 Parent(s): 7975ec5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -23,7 +23,6 @@ transcriber = pipeline(
23
 
24
  # --- 2. Client LLM ---
25
  client = InferenceClient(
26
- provider="fireworks-ai",
27
  token=HF_TOKEN
28
  )
29
 
@@ -51,16 +50,15 @@ def query_llm(text):
51
  return "Je n'ai rien entendu."
52
 
53
  try:
54
- # Prompt système pour guider le modèle à être concis (mieux pour le TTS)
55
  messages = [
56
  {"role": "system", "content": "You are a helpful vocal assistant. Keep your answers short and concise suitable for speech synthesis."},
57
  {"role": "user", "content": text}
58
  ]
59
 
60
  completion = client.chat.completions.create(
61
- model="meta-llama/Meta-Llama-3.1-8B-Instruct",
62
  messages=messages,
63
- max_tokens=150 # Limite pour éviter une synthèse trop longue
64
  )
65
  return completion.choices[0].message.content
66
  except Exception as e:
 
23
 
24
  # --- 2. Client LLM ---
25
  client = InferenceClient(
 
26
  token=HF_TOKEN
27
  )
28
 
 
50
  return "Je n'ai rien entendu."
51
 
52
  try:
 
53
  messages = [
54
  {"role": "system", "content": "You are a helpful vocal assistant. Keep your answers short and concise suitable for speech synthesis."},
55
  {"role": "user", "content": text}
56
  ]
57
 
58
  completion = client.chat.completions.create(
59
+ model="meta-llama/Meta-Llama-3.1-8B-Instruct",
60
  messages=messages,
61
+ max_tokens=150
62
  )
63
  return completion.choices[0].message.content
64
  except Exception as e: