Nana Fouvle Yaaba Nkrumah
commited on
Upload 2 files
Browse files- app.py +4 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -2,11 +2,13 @@ import streamlit as st
|
|
2 |
import re
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
from huggingface_hub import hf_hub_download
|
|
|
5 |
|
6 |
# Attempt to download and load the model from Hugging Face
|
7 |
try:
|
8 |
-
model_path = hf_hub_download(repo_id="Yaaba/Final_Project", filename="fasttext_model.pkl")
|
9 |
-
|
|
|
10 |
# Load the model
|
11 |
model = AutoModelForCausalLM.from_pretrained(model_path)
|
12 |
# If tokenizer is not needed, omit it
|
|
|
2 |
import re
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
+
import pickle
|
6 |
|
7 |
# Attempt to download and load the model from Hugging Face
|
8 |
try:
|
9 |
+
# model_path = hf_hub_download(repo_id="Yaaba/Final_Project", filename="fasttext_model.pkl")
|
10 |
+
model_path = pickle.load(open('fasttext_model.pkl', 'rb'))
|
11 |
+
|
12 |
# Load the model
|
13 |
model = AutoModelForCausalLM.from_pretrained(model_path)
|
14 |
# If tokenizer is not needed, omit it
|
requirements.txt
CHANGED
@@ -5,3 +5,4 @@ numpy
|
|
5 |
tensorflow
|
6 |
torch
|
7 |
transformers
|
|
|
|
5 |
tensorflow
|
6 |
torch
|
7 |
transformers
|
8 |
+
pickle
|