Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def analyze_sentiment(text):
|
|
| 16 |
output = query({
|
| 17 |
"inputs": f'''<|begin_of_text|>
|
| 18 |
<|start_header_id|>system<|end_header_id|>
|
| 19 |
-
You are a feeling analyser and you'll say only "positive1" if I'm feeling positive and "negative1" if I'm feeling sad
|
| 20 |
<|eot_id|>
|
| 21 |
<|start_header_id|>user<|end_header_id|>
|
| 22 |
{text}
|
|
@@ -33,13 +33,12 @@ You are a feeling analyser and you'll say only "positive1" if I'm feeling positi
|
|
| 33 |
|
| 34 |
positive_count = response.count('positive1')
|
| 35 |
negative_count = response.count('negative1')
|
| 36 |
-
|
| 37 |
if positive_count >= 2:
|
| 38 |
return 'positive'
|
| 39 |
elif negative_count >= 2:
|
| 40 |
return 'negative'
|
| 41 |
else:
|
| 42 |
-
return f"
|
| 43 |
|
| 44 |
|
| 45 |
demo = gr.Interface(
|
|
|
|
| 16 |
output = query({
|
| 17 |
"inputs": f'''<|begin_of_text|>
|
| 18 |
<|start_header_id|>system<|end_header_id|>
|
| 19 |
+
You are a feeling analyser and you'll say only "positive1" if I'm feeling positive and "negative1" if I'm feeling sad.
|
| 20 |
<|eot_id|>
|
| 21 |
<|start_header_id|>user<|end_header_id|>
|
| 22 |
{text}
|
|
|
|
| 33 |
|
| 34 |
positive_count = response.count('positive1')
|
| 35 |
negative_count = response.count('negative1')
|
|
|
|
| 36 |
if positive_count >= 2:
|
| 37 |
return 'positive'
|
| 38 |
elif negative_count >= 2:
|
| 39 |
return 'negative'
|
| 40 |
else:
|
| 41 |
+
return f"oups I don't know"
|
| 42 |
|
| 43 |
|
| 44 |
demo = gr.Interface(
|