Spaces:
Runtime error
Runtime error
Changes in app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,7 @@ if torch.cuda.is_available():
|
|
38 |
|
39 |
@spaces.GPU
|
40 |
def generate(
|
|
|
41 |
message: str,
|
42 |
chat_history: list[tuple[str, str]],
|
43 |
system_prompt: str,
|
@@ -62,6 +63,7 @@ def generate(
|
|
62 |
|
63 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
64 |
generate_kwargs = dict(
|
|
|
65 |
inputs,
|
66 |
streamer=streamer,
|
67 |
max_new_tokens=max_new_tokens,
|
@@ -84,6 +86,7 @@ def generate(
|
|
84 |
chat_interface = gr.ChatInterface(
|
85 |
fn=generate,
|
86 |
additional_inputs=[
|
|
|
87 |
gr.Textbox(label="System prompt", value=DEFAULT_SYSTEM_PROMPT, lines=6),
|
88 |
gr.Slider(
|
89 |
label="Max new tokens",
|
|
|
38 |
|
39 |
@spaces.GPU
|
40 |
def generate(
|
41 |
+
tokenizer,
|
42 |
message: str,
|
43 |
chat_history: list[tuple[str, str]],
|
44 |
system_prompt: str,
|
|
|
63 |
|
64 |
streamer = TextIteratorStreamer(tokenizer, timeout=10.0, skip_prompt=True, skip_special_tokens=True)
|
65 |
generate_kwargs = dict(
|
66 |
+
tokenizer,
|
67 |
inputs,
|
68 |
streamer=streamer,
|
69 |
max_new_tokens=max_new_tokens,
|
|
|
86 |
chat_interface = gr.ChatInterface(
|
87 |
fn=generate,
|
88 |
additional_inputs=[
|
89 |
+
tokenizer,
|
90 |
gr.Textbox(label="System prompt", value=DEFAULT_SYSTEM_PROMPT, lines=6),
|
91 |
gr.Slider(
|
92 |
label="Max new tokens",
|