Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
import torch
|
4 |
-
|
|
|
5 |
|
6 |
# Set the title of the Streamlit app
|
7 |
st.title("Text Classification with Hugging Face Transformers")
|
8 |
|
9 |
# Function to download the model from Google Drive
|
10 |
def download_model_from_drive(file_id, dest_path):
|
11 |
-
|
|
|
12 |
|
13 |
# Download the model files
|
14 |
with st.spinner("Downloading model..."):
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
import torch
|
4 |
+
import gdown
|
5 |
+
import os
|
6 |
|
7 |
# Set the title of the Streamlit app
|
8 |
st.title("Text Classification with Hugging Face Transformers")
|
9 |
|
10 |
# Function to download the model from Google Drive
|
11 |
def download_model_from_drive(file_id, dest_path):
|
12 |
+
url = f'https://drive.google.com/uc?id={file_id}'
|
13 |
+
gdown.download(url, dest_path, quiet=False)
|
14 |
|
15 |
# Download the model files
|
16 |
with st.spinner("Downloading model..."):
|