mbwolff
commited on
Commit
·
b2501ac
1
Parent(s):
46fb759
Maybe now?
Browse files
app.py
CHANGED
|
@@ -7,9 +7,9 @@ def random_response(message, history):
|
|
| 7 |
return random.choice(["Yes", "No"])
|
| 8 |
|
| 9 |
def eqa(message, history):
|
| 10 |
-
if len(history) >= 1 and history[-1]['content'] == 'Okay':
|
| 11 |
-
pipe = pipeline(
|
| 12 |
-
return pipe(message)
|
| 13 |
else:
|
| 14 |
return 'Okay'
|
| 15 |
|
|
|
|
| 7 |
return random.choice(["Yes", "No"])
|
| 8 |
|
| 9 |
def eqa(message, history):
|
| 10 |
+
if len(history) >= 1 and history[-1]['role'] == 'assistant' and history[-1]['content'] == 'Okay':
|
| 11 |
+
pipe = pipeline(model="mbwolff/distilbert-base-uncased-finetuned-squad")
|
| 12 |
+
return pipe(question=message, context=history[-2]['content'])['answer']
|
| 13 |
else:
|
| 14 |
return 'Okay'
|
| 15 |
|