alex-abb commited on
Commit
fe257b1
·
verified ·
1 Parent(s): 49c5437

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -18,8 +18,7 @@ def analyze_sentiment(text):
18
  output = query({
19
  "inputs": f'''<|begin_of_text|>
20
  <|start_header_id|>system<|end_header_id|>
21
- You'll only answer in English.
22
- <|eot_id|>
23
  <|start_header_id|>user<|end_header_id|>
24
  {text}
25
  <|eot_id|>
@@ -29,7 +28,7 @@ def analyze_sentiment(text):
29
 
30
  # Assurez-vous de gérer correctement la sortie de l'API
31
  if isinstance(output, list) and len(output) > 0:
32
- return output[0].get('generated_text', 'Erreur: Réponse inattendue')
33
  else:
34
  return "Erreur: Réponse inattendue de l'API"
35
 
 
18
  output = query({
19
  "inputs": f'''<|begin_of_text|>
20
  <|start_header_id|>system<|end_header_id|>
21
+ you are a feeling analyser and you'll say only "positive" if i'm feeling positive and "negativ" if i'm feeling sad or bad <|eot_id|>
 
22
  <|start_header_id|>user<|end_header_id|>
23
  {text}
24
  <|eot_id|>
 
28
 
29
  # Assurez-vous de gérer correctement la sortie de l'API
30
  if isinstance(output, list) and len(output) > 0:
31
+ return output[0].get('generated_text', 'Err eur: Réponse inattendue')
32
  else:
33
  return "Erreur: Réponse inattendue de l'API"
34