Spaces:
Runtime error
Runtime error
Update app.py
Browse filesOutput tensors and their text representation
app.py
CHANGED
@@ -176,9 +176,10 @@ def generate(starting_text):
|
|
176 |
#response = gpt2_tensors
|
177 |
for i, x in enumerate(gpt2_tensors):
|
178 |
response=response+f"{i}: {gpt2_tkn.decode(x, skip_special_tokens=True)}" # Decode tensors into text
|
179 |
-
return response
|
180 |
|
181 |
txt=grad.Textbox(lines=1, label="English", placeholder="English Text here")
|
182 |
-
|
|
|
183 |
|
184 |
-
grad.Interface(generate, inputs=txt, outputs=
|
|
|
176 |
#response = gpt2_tensors
|
177 |
for i, x in enumerate(gpt2_tensors):
|
178 |
response=response+f"{i}: {gpt2_tkn.decode(x, skip_special_tokens=True)}" # Decode tensors into text
|
179 |
+
return gpt2_tensors, response
|
180 |
|
181 |
txt=grad.Textbox(lines=1, label="English", placeholder="English Text here")
|
182 |
+
out_tensors=grad.Textbox(lines=1, label="Generated Tensors")
|
183 |
+
out_text=grad.Textbox(lines=1, label="Generated Text")
|
184 |
|
185 |
+
grad.Interface(generate, inputs=txt, outputs=[out_tensors, out_text]).launch()
|