Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,23 +2,6 @@ import zipfile
|
|
| 2 |
import sys
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
|
| 6 |
-
def unzip_file(zip_path, extract_to=None):
|
| 7 |
-
# Check if extract_to is provided, otherwise extract in the current directory
|
| 8 |
-
if extract_to is None:
|
| 9 |
-
extract_to = os.path.dirname(zip_path) # Extract in the same directory as the zip file
|
| 10 |
-
|
| 11 |
-
# Open the zip file
|
| 12 |
-
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
| 13 |
-
# Extract all the contents into the extract_to directory
|
| 14 |
-
zip_ref.extractall(extract_to)
|
| 15 |
-
print(f"Extracted all files to {extract_to}")
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
zip_file_path = 'models.zip' # Replace with your zip file path
|
| 19 |
-
unzip_file(zip_file_path) # This will extract to the same directory as the zip file
|
| 20 |
-
|
| 21 |
-
|
| 22 |
# Check current directory and list files
|
| 23 |
print("Current Directory:", os.getcwd())
|
| 24 |
print("Files in Directory:", os.listdir())
|
|
@@ -31,8 +14,8 @@ import tensorflow_hub as hub
|
|
| 31 |
import tf_keras as keras
|
| 32 |
import pandas as pd
|
| 33 |
from tensorflow.keras.models import load_model
|
| 34 |
-
from
|
| 35 |
-
from
|
| 36 |
import joblib
|
| 37 |
|
| 38 |
import gradio as gr
|
|
|
|
| 2 |
import sys
|
| 3 |
import os
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Check current directory and list files
|
| 6 |
print("Current Directory:", os.getcwd())
|
| 7 |
print("Files in Directory:", os.listdir())
|
|
|
|
| 14 |
import tf_keras as keras
|
| 15 |
import pandas as pd
|
| 16 |
from tensorflow.keras.models import load_model
|
| 17 |
+
from official.nlp.data import classifier_data_lib
|
| 18 |
+
from official.nlp.tools import tokenization
|
| 19 |
import joblib
|
| 20 |
|
| 21 |
import gradio as gr
|