Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,17 +14,17 @@ def echo(message, history, model):
|
|
14 |
|
15 |
if model=="gpt2-medium":
|
16 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
17 |
-
answer =
|
18 |
return answer
|
19 |
|
20 |
elif model=="gpt2-medium":
|
21 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
22 |
-
answer =
|
23 |
return answer
|
24 |
|
25 |
elif model=="gpt2-medium":
|
26 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
27 |
-
answer =
|
28 |
return answer
|
29 |
|
30 |
|
|
|
14 |
|
15 |
if model=="gpt2-medium":
|
16 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
17 |
+
answer = answer[answer.find(f"RACHEL: ") + len("RACHEL") + 2 : answer.find('</s>')]
|
18 |
return answer
|
19 |
|
20 |
elif model=="gpt2-medium":
|
21 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
22 |
+
answer = answer[answer.find(f"RACHEL: ") + len("RACHEL") + 2 : answer.find('</s>')]
|
23 |
return answer
|
24 |
|
25 |
elif model=="gpt2-medium":
|
26 |
answer = chef(f"<s>NOTFRIEND: {message}\nRACHEL:")[0]['generated_text']
|
27 |
+
answer = answer[answer.find(f"RACHEL: ") + len("RACHEL") + 2 : answer.find('</s>')]
|
28 |
return answer
|
29 |
|
30 |
|