Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,6 +23,10 @@ def gradio_predict(input_text):
|
|
| 23 |
input_ids = np.array(tokenized_input["input_ids"], dtype=np.int64) # Shape should be [1, 512]
|
| 24 |
attention_mask = np.array(tokenized_input["attention_mask"], dtype=np.int64) # Shape should be [1, 512]
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
# Prepare decoder input ids if required by your model
|
| 27 |
decoder_input_ids = input_ids # Adjust as needed based on model requirements
|
| 28 |
|
|
|
|
| 23 |
input_ids = np.array(tokenized_input["input_ids"], dtype=np.int64) # Shape should be [1, 512]
|
| 24 |
attention_mask = np.array(tokenized_input["attention_mask"], dtype=np.int64) # Shape should be [1, 512]
|
| 25 |
|
| 26 |
+
# Ensure input is in the correct shape and format for ONNX
|
| 27 |
+
input_ids = input_ids.astype(np.int64)
|
| 28 |
+
attention_mask = attention_mask.astype(np.int64)
|
| 29 |
+
|
| 30 |
# Prepare decoder input ids if required by your model
|
| 31 |
decoder_input_ids = input_ids # Adjust as needed based on model requirements
|
| 32 |
|