Neal Caren commited on
Commit ·
e362020
1
Parent(s): 824a684
Online loading
Browse files
app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
import pandas as pd
|
| 4 |
from glob import glob
|
| 5 |
from scipy import spatial
|
|
@@ -8,6 +6,7 @@ from collections import defaultdict
|
|
| 8 |
import tiktoken
|
| 9 |
import openai
|
| 10 |
import gradio as gr
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
|
|
@@ -191,7 +190,10 @@ with block:
|
|
| 191 |
research_btn = gr.Button(value="Ask the archive")
|
| 192 |
output_block = gr.Markdown(label="Response")
|
| 193 |
research_btn.click(ask, inputs=input_block, outputs=output_block)
|
| 194 |
-
gr.Examples(["What is the relationship between social, political and economic equality?",
|
|
|
|
|
|
|
|
|
|
| 195 |
gr.Markdown(outro_text)
|
| 196 |
|
| 197 |
# Launch the interface
|
|
|
|
|
|
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
from glob import glob
|
| 3 |
from scipy import spatial
|
|
|
|
| 6 |
import tiktoken
|
| 7 |
import openai
|
| 8 |
import gradio as gr
|
| 9 |
+
from tenacity import retry, stop_after_attempt, wait_random_exponential
|
| 10 |
|
| 11 |
|
| 12 |
|
|
|
|
| 190 |
research_btn = gr.Button(value="Ask the archive")
|
| 191 |
output_block = gr.Markdown(label="Response")
|
| 192 |
research_btn.click(ask, inputs=input_block, outputs=output_block)
|
| 193 |
+
gr.Examples(["What is the relationship between social, political and economic equality?",
|
| 194 |
+
"What is Pan-Africanism?",
|
| 195 |
+
"Did Du Bois support American involvement in WWI?",
|
| 196 |
+
"Why was the NAACP founded and what was it's original goals?"], inputs=[input_block])
|
| 197 |
gr.Markdown(outro_text)
|
| 198 |
|
| 199 |
# Launch the interface
|