Spaces:
Build error
Build error
Commit
•
03f2a71
1
Parent(s):
b810035
Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def summarize(inp, model=model, tokenizer=tokenizer, device=device):
|
|
55 |
inputs = tokenizer(inp, return_tensors="pt", padding=True).to(device)
|
56 |
batch_size, sequence_length = inputs["input_ids"].shape
|
57 |
max_cache_length = 1024
|
58 |
-
max_new_tokens =
|
59 |
# setup static cache
|
60 |
past_key_values = StaticCache(
|
61 |
config=model.config,
|
@@ -105,5 +105,5 @@ def summarize(inp, model=model, tokenizer=tokenizer, device=device):
|
|
105 |
|
106 |
return response
|
107 |
|
108 |
-
gr.Interface(fn=summarize, inputs=gr.Textbox(lines=7, label="Input Text"), outputs="text", title="gemma-2b
|
109 |
|
|
|
55 |
inputs = tokenizer(inp, return_tensors="pt", padding=True).to(device)
|
56 |
batch_size, sequence_length = inputs["input_ids"].shape
|
57 |
max_cache_length = 1024
|
58 |
+
max_new_tokens = 64
|
59 |
# setup static cache
|
60 |
past_key_values = StaticCache(
|
61 |
config=model.config,
|
|
|
105 |
|
106 |
return response
|
107 |
|
108 |
+
gr.Interface(fn=summarize, inputs=gr.Textbox(lines=7, label="Input Text"), outputs="text", title="gemma-2b simple TPU demo").launch(inline=False)
|
109 |
|