Spaces:
Sleeping
Sleeping
Switched to Facebook model
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ file_path = "Adrega_P.I._User_Manual.docx"
|
|
| 14 |
#pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
| 16 |
#pipe = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
| 17 |
-
pipe = pipeline("
|
| 18 |
|
| 19 |
st.title("Adrega AI Help")
|
| 20 |
#dataset = load_dataset("andreska/adregadocs", split="test")
|
|
@@ -28,9 +28,11 @@ if st.button("Submit"):
|
|
| 28 |
#text_inputs = f"Context: {context}\nQuestion: {user_input}\nAnswer:"
|
| 29 |
#result = pipe(text_inputs, max_length=200, num_return_sequences=1)[0]['generated_text']
|
| 30 |
#answer = result.split("Answer:")[1].strip()
|
| 31 |
-
answer = pipe(question=user_input, context=context)
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
st.write(f"Adrega AI: {answer}")
|
| 34 |
else:
|
| 35 |
st.write("Please enter a question.")
|
| 36 |
|
|
|
|
| 14 |
#pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
| 16 |
#pipe = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
| 17 |
+
pipe = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 18 |
|
| 19 |
st.title("Adrega AI Help")
|
| 20 |
#dataset = load_dataset("andreska/adregadocs", split="test")
|
|
|
|
| 28 |
#text_inputs = f"Context: {context}\nQuestion: {user_input}\nAnswer:"
|
| 29 |
#result = pipe(text_inputs, max_length=200, num_return_sequences=1)[0]['generated_text']
|
| 30 |
#answer = result.split("Answer:")[1].strip()
|
| 31 |
+
#answer = pipe(question=user_input, context=context)
|
| 32 |
+
answer = pipe(context, max_length=512, min_length=100, do_sample=False)
|
| 33 |
+
st.write(f"Adrega AI: {answer[0]['summary_text']}")
|
| 34 |
|
| 35 |
+
#st.write(f"Adrega AI: {answer}")
|
| 36 |
else:
|
| 37 |
st.write("Please enter a question.")
|
| 38 |
|