Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,18 +8,9 @@ from tensorflow.keras.preprocessing.text import Tokenizer
|
|
| 8 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 9 |
import subprocess
|
| 10 |
|
| 11 |
-
# Command to execute
|
| 12 |
-
command = "git clone https://huggingface.co/lydiadida/lstmhatespeachdetection"
|
| 13 |
-
|
| 14 |
-
# Execute the command
|
| 15 |
-
try:
|
| 16 |
-
subprocess.run(command, shell=True, check=True)
|
| 17 |
-
print("Git clone command executed successfully.")
|
| 18 |
-
except subprocess.CalledProcessError as e:
|
| 19 |
-
print(f"Error executing git clone command: {e}")
|
| 20 |
|
| 21 |
# Load the LSTM model
|
| 22 |
-
model_path = "
|
| 23 |
|
| 24 |
def load_lstm_model(model_path):
|
| 25 |
return load_model(model_path)
|
|
|
|
| 8 |
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 9 |
import subprocess
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Load the LSTM model
|
| 13 |
+
model_path = "my_model.h5" # Set your model path here
|
| 14 |
|
| 15 |
def load_lstm_model(model_path):
|
| 16 |
return load_model(model_path)
|