Spaces:
Runtime error
Runtime error
Jingxiang Mo
commited on
Commit
·
3d68848
1
Parent(s):
77eba15
Quick fix
Browse files- __pycache__/app.cpython-39.pyc +0 -0
- app.py +2 -3
__pycache__/app.cpython-39.pyc
ADDED
|
Binary file (4.14 kB). View file
|
|
|
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from transformers import (
|
|
| 12 |
)
|
| 13 |
from transformers.pipelines import AggregationStrategy
|
| 14 |
import torch
|
| 15 |
-
|
| 16 |
# =====[ DEFINE PIPELINE ]===== #
|
| 17 |
class KeyphraseExtractionPipeline(TokenClassificationPipeline):
|
| 18 |
def __init__(self, model, *args, **kwargs):
|
|
@@ -48,7 +48,6 @@ def wikipedia_search(input: str) -> str:
|
|
| 48 |
wiki = wk.Wikipedia('en')
|
| 49 |
|
| 50 |
try :
|
| 51 |
-
#TODO: add better extraction and search
|
| 52 |
if len(keyphrases) == 0:
|
| 53 |
return "Can you add more details to your question?"
|
| 54 |
|
|
@@ -162,7 +161,7 @@ def answer_question(question):
|
|
| 162 |
return final_answer
|
| 163 |
|
| 164 |
# =====[ DEFINE INTERFACE ]===== #'
|
| 165 |
-
title = "Azza
|
| 166 |
examples = [
|
| 167 |
["Where is the Eiffel Tower?"],
|
| 168 |
["What is the population of France?"]
|
|
|
|
| 12 |
)
|
| 13 |
from transformers.pipelines import AggregationStrategy
|
| 14 |
import torch
|
| 15 |
+
|
| 16 |
# =====[ DEFINE PIPELINE ]===== #
|
| 17 |
class KeyphraseExtractionPipeline(TokenClassificationPipeline):
|
| 18 |
def __init__(self, model, *args, **kwargs):
|
|
|
|
| 48 |
wiki = wk.Wikipedia('en')
|
| 49 |
|
| 50 |
try :
|
|
|
|
| 51 |
if len(keyphrases) == 0:
|
| 52 |
return "Can you add more details to your question?"
|
| 53 |
|
|
|
|
| 161 |
return final_answer
|
| 162 |
|
| 163 |
# =====[ DEFINE INTERFACE ]===== #'
|
| 164 |
+
title = "Azza Q/A Agent"
|
| 165 |
examples = [
|
| 166 |
["Where is the Eiffel Tower?"],
|
| 167 |
["What is the population of France?"]
|