Spaces:
Running
Running
Commit
•
a9310a4
1
Parent(s):
ce501a6
Update gradio_app.py
Browse files- gradio_app.py +2 -2
gradio_app.py
CHANGED
@@ -36,7 +36,7 @@ Or you can once follow steps in Dockerfile and try it on your machine, not in Do
|
|
36 |
with open('system.prompt', 'r', encoding='utf-8') as f:
|
37 |
prompt = f.read()
|
38 |
|
39 |
-
def
|
40 |
try:
|
41 |
maxTokens = max_tokens if 16 <= max_tokens <= 256 else 64
|
42 |
if isinstance(custom_prompt, str):
|
@@ -67,7 +67,7 @@ def translate(request: str, max_tokens: int = 256, language: str = "en", custom_
|
|
67 |
|
68 |
|
69 |
demo = gr.Interface(
|
70 |
-
fn=
|
71 |
inputs=[
|
72 |
gr.components.Textbox(label="Input"),
|
73 |
gr.components.Number(value=256),
|
|
|
36 |
with open('system.prompt', 'r', encoding='utf-8') as f:
|
37 |
prompt = f.read()
|
38 |
|
39 |
+
def generate_answer(request: str, max_tokens: int = 256, language: str = "en", custom_prompt: str = None):
|
40 |
try:
|
41 |
maxTokens = max_tokens if 16 <= max_tokens <= 256 else 64
|
42 |
if isinstance(custom_prompt, str):
|
|
|
67 |
|
68 |
|
69 |
demo = gr.Interface(
|
70 |
+
fn=generate_answer,
|
71 |
inputs=[
|
72 |
gr.components.Textbox(label="Input"),
|
73 |
gr.components.Number(value=256),
|