Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,13 +13,24 @@ app = App.from_config(config={
|
|
13 |
"max_tokens": 1000,
|
14 |
"top_p": 1,
|
15 |
"stream": False,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
},
|
17 |
},
|
18 |
"embedder": {
|
19 |
"provider": "google",
|
20 |
"config": {
|
21 |
"model": "models/embedding-001",
|
22 |
-
|
23 |
},
|
24 |
},
|
25 |
})
|
@@ -27,8 +38,6 @@ app = App.from_config(config={
|
|
27 |
app.add('http://www.droit-afrique.com/uploads/Gabon-Code-2019-penal.pdf', data_type='pdf_file')
|
28 |
|
29 |
|
30 |
-
|
31 |
-
|
32 |
def query(message, history):
|
33 |
return app.chat(message)
|
34 |
|
|
|
13 |
"max_tokens": 1000,
|
14 |
"top_p": 1,
|
15 |
"stream": False,
|
16 |
+
"template": """
|
17 |
+
Use the following pieces of context to answer the query at the end.
|
18 |
+
If you don't know the answer, just say that you don't know, don't try to make up an answer.
|
19 |
+
|
20 |
+
$context
|
21 |
+
|
22 |
+
Query: $query
|
23 |
+
|
24 |
+
Helpful Answer:
|
25 |
+
system_prompt: |
|
26 |
+
Act as William Shakespeare. Answer the following questions in the style of William Shakespeare.
|
27 |
+
"""
|
28 |
},
|
29 |
},
|
30 |
"embedder": {
|
31 |
"provider": "google",
|
32 |
"config": {
|
33 |
"model": "models/embedding-001",
|
|
|
34 |
},
|
35 |
},
|
36 |
})
|
|
|
38 |
app.add('http://www.droit-afrique.com/uploads/Gabon-Code-2019-penal.pdf', data_type='pdf_file')
|
39 |
|
40 |
|
|
|
|
|
41 |
def query(message, history):
|
42 |
return app.chat(message)
|
43 |
|