Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- app.py +41 -0
- embedchain.json +4 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
from embedchain import App
|
6 |
+
|
7 |
+
|
8 |
+
import os
|
9 |
+
|
10 |
+
|
11 |
+
#Initializing the Embedchain application with open source configuration
|
12 |
+
config = {
|
13 |
+
'llm': {
|
14 |
+
'provider': 'huggingface',
|
15 |
+
'config': {
|
16 |
+
'model': 'mistralai/Mistral-7B-Instruct-v0.2',
|
17 |
+
'top_p': 0.5
|
18 |
+
}
|
19 |
+
},
|
20 |
+
'embedder': {
|
21 |
+
'provider': 'huggingface',
|
22 |
+
'config': {
|
23 |
+
'model': 'sentence-transformers/all-mpnet-base-v2'
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
27 |
+
app = App.from_config(config=config)
|
28 |
+
# Add data to the app
|
29 |
+
app.add("https://voxiitk.com/scrapping-of-galaxy24/")
|
30 |
+
app.add("https://voxiitk.com/administration-responds-to-students-senates-demands/")
|
31 |
+
app.add("https://voxiitk.com/yeh-hall-ab-13-na-raha/")
|
32 |
+
app.add("https://voxiitk.com/girls-protest-at-directors-residence/")
|
33 |
+
app.add("https://www.iitk.ac.in/doaa/data/UG-Manual.pdf")
|
34 |
+
|
35 |
+
def query(message, history):
|
36 |
+
return app.chat(message)
|
37 |
+
|
38 |
+
|
39 |
+
demo = gr.ChatInterface(query)
|
40 |
+
|
41 |
+
demo.launch()
|
embedchain.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "VOX_RAG",
|
3 |
+
"provider": "hf/gradio.app"
|
4 |
+
}
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio==4.11.0
|
2 |
+
embedchain
|