Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,15 +23,15 @@ prompt_template = "Responda as questões.\nHuman: {prompt}\nAssistant:\n"
|
|
23 |
def get_response(text):
|
24 |
prompt = prompt_template.format(prompt=text)
|
25 |
response = lcpp_llm(
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
return response
|
35 |
|
36 |
interface = gr.Interface(
|
37 |
fn=get_response,
|
|
|
23 |
def get_response(text):
|
24 |
prompt = prompt_template.format(prompt=text)
|
25 |
response = lcpp_llm(
|
26 |
+
prompt=prompt,
|
27 |
+
max_tokens=256,
|
28 |
+
temperature=0.5,
|
29 |
+
top_p=0.95,
|
30 |
+
top_k=50,
|
31 |
+
stop = ['<|end_of_text|>'], # Dynamic stopping when such token is detected.
|
32 |
+
echo=True # return the prompt
|
33 |
+
)
|
34 |
+
return response['choices'][0]['text'].split('Assistant:\n')[1]
|
35 |
|
36 |
interface = gr.Interface(
|
37 |
fn=get_response,
|