Update app.py
Browse files
app.py
CHANGED
@@ -76,8 +76,9 @@ def save_uploadedfile(uploadedfile):
|
|
76 |
return st.success("Saved File:{} to tempDir".format(uploadedfile.name))
|
77 |
|
78 |
def ricerca_llama(domanda):
|
|
|
79 |
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
80 |
-
risultato = client.predict( str(domanda),"you are a university professor, use appropriate language to answer students' questions .",0.
|
81 |
print(domanda)
|
82 |
risultato=str(risultato).split("<")[0]
|
83 |
return risultato
|
|
|
76 |
return st.success("Saved File:{} to tempDir".format(uploadedfile.name))
|
77 |
|
78 |
def ricerca_llama(domanda):
|
79 |
+
domanda=domanda.replace("Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.","Act as if you were a university professor. The following are excerpts from your lectures; emulate the way of speaking/writing and respond to the question at the end. If there is no answer to the question in the context, simply say that you don't know how to answer. NEVER MAKE UP AN ANSWER; USE ONLY AND EXCLUSIVELY THE CONTEXT.")
|
80 |
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
81 |
+
risultato = client.predict( str(domanda),"you are a university professor, use appropriate language to answer students' questions .",0.0,2000,0.1,1.1,api_name="/chat")
|
82 |
print(domanda)
|
83 |
risultato=str(risultato).split("<")[0]
|
84 |
return risultato
|