shoom013 commited on
Commit
7750c4a
·
verified ·
1 Parent(s): 4f66cb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -11,6 +11,10 @@ from llama_index.llms.huggingface import (
11
  HuggingFaceLLM,
12
  )
13
  from huggingface_hub import login
 
 
 
 
14
  CHROMA_DATA_PATH = "chroma_data/"
15
  EMBED_MODEL = "BAAI/bge-m3"
16
  # all-MiniLM-L6-v2
@@ -46,11 +50,7 @@ HF_TOKEN = "wncSKewozDfuZCXCyFbYbAMHgUrfcrumkc"
46
  #
47
  login(token=("hf_" + HF_TOKEN))
48
 
49
- #system_sr = "Zoveš se U-Chat AI asistent i pomažeš korisniku usluga kompanije United Group. Korisnik postavlja pitanje ili problem, upareno sa dodatnima saznanjima. Na osnovu toga napiši korisniku kratak i ljubazan odgovor koji kompletira njegov zahtev ili mu daje odgovor na pitanje. "
50
- # " Ako ne znaš odgovor, reci da ne znaš, ne izmišljaj ga."
51
- #system_sr += "Usluge kompanije United Group uključuju i kablovsku mrežu za digitalnu televiziju, pristup internetu, uređaj EON SMART BOX za TV sadržaj, kao i fiksnu telefoniju."
52
-
53
- system_propmpt = "You are a friendly Chatbot."
54
 
55
  # "facebook/blenderbot-400M-distill", facebook/blenderbot-400M-distill, stabilityai/stablelm-zephyr-3b, BAAI/bge-small-en-v1.5
56
  Settings.llm = HuggingFaceInferenceAPI(model_name="mistralai/Mistral-Nemo-Instruct-2407",
@@ -79,9 +79,9 @@ def rag(input_text, file):
79
  input_text
80
  )
81
 
82
- iface = gr.Interface(fn=rag, inputs=[gr.Textbox(label="Question", lines=6), gr.File()],
83
- outputs=[gr.Textbox(label="Result", lines=6)],
84
- title="Answer my question",
85
  description= "UChat"
86
  )
87
  iface.launch()
 
11
  HuggingFaceLLM,
12
  )
13
  from huggingface_hub import login
14
+ import chromadb as chromadb
15
+ from chromadb.utils import embedding_functions
16
+ #
17
+
18
  CHROMA_DATA_PATH = "chroma_data/"
19
  EMBED_MODEL = "BAAI/bge-m3"
20
  # all-MiniLM-L6-v2
 
50
  #
51
  login(token=("hf_" + HF_TOKEN))
52
 
53
+ system_propmpt = system_sr
 
 
 
 
54
 
55
  # "facebook/blenderbot-400M-distill", facebook/blenderbot-400M-distill, stabilityai/stablelm-zephyr-3b, BAAI/bge-small-en-v1.5
56
  Settings.llm = HuggingFaceInferenceAPI(model_name="mistralai/Mistral-Nemo-Instruct-2407",
 
79
  input_text
80
  )
81
 
82
+ iface = gr.Interface(fn=rag, inputs=[gr.Textbox(label="Pitanje:", lines=6), gr.File()],
83
+ outputs=[gr.Textbox(label="Odgovor:", lines=6)],
84
+ title="Kako Vam mogu pomoći?",
85
  description= "UChat"
86
  )
87
  iface.launch()