Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ def format_prompt(message, history):
|
|
| 43 |
return prompt
|
| 44 |
|
| 45 |
def generate(
|
| 46 |
-
|
| 47 |
):
|
| 48 |
temperature = float(temperature)
|
| 49 |
if temperature < 1e-2:
|
|
@@ -59,7 +59,7 @@ def generate(
|
|
| 59 |
seed=42,
|
| 60 |
)
|
| 61 |
|
| 62 |
-
formatted_prompt = format_prompt(
|
| 63 |
|
| 64 |
stream = client.text_generation(
|
| 65 |
formatted_prompt,
|
|
@@ -116,7 +116,8 @@ additional_inputs = [
|
|
| 116 |
|
| 117 |
gr.ChatInterface(
|
| 118 |
fn=generate,
|
| 119 |
-
|
|
|
|
| 120 |
show_label=False,
|
| 121 |
show_share_button=False,
|
| 122 |
show_copy_button=True,
|
|
|
|
| 43 |
return prompt
|
| 44 |
|
| 45 |
def generate(
|
| 46 |
+
message, history, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
|
| 47 |
):
|
| 48 |
temperature = float(temperature)
|
| 49 |
if temperature < 1e-2:
|
|
|
|
| 59 |
seed=42,
|
| 60 |
)
|
| 61 |
|
| 62 |
+
formatted_prompt = format_prompt(message, history)
|
| 63 |
|
| 64 |
stream = client.text_generation(
|
| 65 |
formatted_prompt,
|
|
|
|
| 116 |
|
| 117 |
gr.ChatInterface(
|
| 118 |
fn=generate,
|
| 119 |
+
inputs=[gr.Textbox(label="Interviewer", type="text", default=initial_prompt)],
|
| 120 |
+
outputs=gr.Chatbot(
|
| 121 |
show_label=False,
|
| 122 |
show_share_button=False,
|
| 123 |
show_copy_button=True,
|