Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ragatouille import RAGPretrainedModel
|
2 |
+
import os
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
|
6 |
+
path_to_index = 'colbert/indexes/akhooli/Arabic-ColBERT-100knew_index'
|
7 |
+
message = "waiting to load index ..."
|
8 |
+
if os.path.exists(path_to_index):
|
9 |
+
RAG = RAGPretrainedModel.from_index(path_to_index)
|
10 |
+
print('RAG loaded from index')
|
11 |
+
message = "index loaded!"
|
12 |
+
import gradio as gr
|
13 |
+
|
14 |
+
def check_fn():
|
15 |
+
return message
|
16 |
+
|
17 |
+
qapp = gr.Interface(fn=check_fn, inputs="textbox", outputs="textbox")
|
18 |
+
if __name__ == "__main__":
|
19 |
+
qapp.launch()
|