Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,12 +6,6 @@ import os
|
|
6 |
|
7 |
# Load the original pre-trained model
|
8 |
def load_model(model_name):
|
9 |
-
hf_token = os.getenv('HUGGINGFACE_TOKEN')
|
10 |
-
if not hf_token:
|
11 |
-
return "Error: Hugging Face token not found. Please set it as a secret."
|
12 |
-
|
13 |
-
# Login to Hugging Face Hub
|
14 |
-
login(hf_token)
|
15 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
16 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
17 |
return tokenizer, model
|
@@ -21,6 +15,12 @@ original_model_name = "Vishwas1/hummingbird-base-marathi" # Replace with your o
|
|
21 |
fine_tuned_model_name = "Vishwas1/hummingbird-finetuned-marathi" # Replace with your fine-tuned model's repo ID
|
22 |
|
23 |
# Load models
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
original_tokenizer = AutoTokenizer.from_pretrained(original_model_name)
|
25 |
original_model = AutoModelForSequenceClassification.from_pretrained(original_model_name)
|
26 |
fine_tuned_tokenizer = AutoTokenizer.from_pretrained(fine_tuned_model_name)
|
|
|
6 |
|
7 |
# Load the original pre-trained model
|
8 |
def load_model(model_name):
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
11 |
return tokenizer, model
|
|
|
15 |
fine_tuned_model_name = "Vishwas1/hummingbird-finetuned-marathi" # Replace with your fine-tuned model's repo ID
|
16 |
|
17 |
# Load models
|
18 |
+
hf_token = os.getenv('HUGGINGFACE_TOKEN')
|
19 |
+
if not hf_token:
|
20 |
+
return "Error: Hugging Face token not found. Please set it as a secret."
|
21 |
+
|
22 |
+
# Login to Hugging Face Hub
|
23 |
+
login(hf_token)
|
24 |
original_tokenizer = AutoTokenizer.from_pretrained(original_model_name)
|
25 |
original_model = AutoModelForSequenceClassification.from_pretrained(original_model_name)
|
26 |
fine_tuned_tokenizer = AutoTokenizer.from_pretrained(fine_tuned_model_name)
|