Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def format_prompt(message, history):
|
|
| 14 |
return prompt
|
| 15 |
|
| 16 |
def generate(
|
| 17 |
-
prompt, history,
|
| 18 |
):
|
| 19 |
temperature = float(temperature)
|
| 20 |
if temperature < 1e-2:
|
|
@@ -30,7 +30,7 @@ def generate(
|
|
| 30 |
seed=42,
|
| 31 |
)
|
| 32 |
|
| 33 |
-
formatted_prompt = format_prompt(f"{
|
| 34 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 35 |
output = ""
|
| 36 |
|
|
@@ -41,14 +41,9 @@ def generate(
|
|
| 41 |
|
| 42 |
|
| 43 |
additional_inputs=[
|
| 44 |
-
gr.Textbox(
|
| 45 |
-
label="System Prompt",
|
| 46 |
-
max_lines=1,
|
| 47 |
-
interactive=True,
|
| 48 |
-
),
|
| 49 |
gr.Slider(
|
| 50 |
label="Temperature",
|
| 51 |
-
value=0.
|
| 52 |
minimum=0.0,
|
| 53 |
maximum=1.0,
|
| 54 |
step=0.05,
|
|
@@ -57,7 +52,7 @@ additional_inputs=[
|
|
| 57 |
),
|
| 58 |
gr.Slider(
|
| 59 |
label="Max new tokens",
|
| 60 |
-
value=
|
| 61 |
minimum=0,
|
| 62 |
maximum=1048,
|
| 63 |
step=64,
|
|
@@ -84,12 +79,10 @@ additional_inputs=[
|
|
| 84 |
)
|
| 85 |
]
|
| 86 |
|
| 87 |
-
examples=[["
|
| 88 |
-
["
|
| 89 |
-
["
|
| 90 |
-
["
|
| 91 |
-
["Can you explain how the QuickSort algorithm works and provide a Python implementation?", None, None, None, None, None,],
|
| 92 |
-
["What are some unique features of Rust that make it stand out compared to other systems programming languages like C++?", None, None, None, None, None,],
|
| 93 |
]
|
| 94 |
|
| 95 |
gr.ChatInterface(
|
|
|
|
| 14 |
return prompt
|
| 15 |
|
| 16 |
def generate(
|
| 17 |
+
prompt, history, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
|
| 18 |
):
|
| 19 |
temperature = float(temperature)
|
| 20 |
if temperature < 1e-2:
|
|
|
|
| 30 |
seed=42,
|
| 31 |
)
|
| 32 |
|
| 33 |
+
formatted_prompt = format_prompt(f"{prompt}", history)
|
| 34 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 35 |
output = ""
|
| 36 |
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
additional_inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
gr.Slider(
|
| 45 |
label="Temperature",
|
| 46 |
+
value=0.1,
|
| 47 |
minimum=0.0,
|
| 48 |
maximum=1.0,
|
| 49 |
step=0.05,
|
|
|
|
| 52 |
),
|
| 53 |
gr.Slider(
|
| 54 |
label="Max new tokens",
|
| 55 |
+
value=1024,
|
| 56 |
minimum=0,
|
| 57 |
maximum=1048,
|
| 58 |
step=64,
|
|
|
|
| 79 |
)
|
| 80 |
]
|
| 81 |
|
| 82 |
+
examples=[["what is self realization according to bhagwan ramana maharishi", None, None, None, None, None, ],
|
| 83 |
+
["How does the teaching of bhagwan ramana maharishi hold good in the bay area for an aspiring startup founder", None, None, None, None, None,],
|
| 84 |
+
["How to teach a 8 year old about ramana maharishi's teaching", None, None, None, None, None,],
|
| 85 |
+
["why don't have the realization of the self like ramana maharishi as a default feature in us , is it not very inefficient for us to realize over the adulthood?", None, None, None, None, None,],
|
|
|
|
|
|
|
| 86 |
]
|
| 87 |
|
| 88 |
gr.ChatInterface(
|