Spaces:
Runtime error
Runtime error
Commit ·
8493dae
1
Parent(s): 76a650f
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,11 @@ def generate_response(text):
|
|
| 16 |
# Get the last hidden states from the model output
|
| 17 |
last_hidden_states = outputs.last_hidden_state
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Return last hidden states as output
|
| 20 |
-
return
|
| 21 |
|
| 22 |
iface = gr.Interface(
|
| 23 |
fn=generate_response,
|
|
|
|
| 16 |
# Get the last hidden states from the model output
|
| 17 |
last_hidden_states = outputs.last_hidden_state
|
| 18 |
|
| 19 |
+
# Convert tensor to a human-readable format
|
| 20 |
+
output_text = "\n".join([str(token) for token in last_hidden_states[0][0]])
|
| 21 |
+
|
| 22 |
# Return last hidden states as output
|
| 23 |
+
return output_text
|
| 24 |
|
| 25 |
iface = gr.Interface(
|
| 26 |
fn=generate_response,
|