Erfan11 commited on
Commit
6f9e18f
1 Parent(s): 14e25f2

Update model_loading.py

Browse files
Files changed (1) hide show
  1. model_loading.py +7 -11
model_loading.py CHANGED
@@ -1,13 +1,9 @@
1
- import os
2
- import requests
3
- from dotenv import load_dotenv
4
 
5
- load_dotenv()
6
- api_key = os.getenv('HF_API_KEY')
7
- model_path = os.getenv('MODEL_PATH')
8
 
9
- def get_model_predictions(text):
10
- headers = {"Authorization": f"Bearer {api_key}"}
11
- payload = {"inputs": text}
12
- response = requests.post(f"https://api.huggingface.co/models/{model_path}", headers=headers, json=payload)
13
- return response.json()
 
1
+ from load_model import load_model
 
 
2
 
3
+ model, tokenizer = load_model()
 
 
4
 
5
+ def get_model():
6
+ return model
7
+
8
+ def get_tokenizer():
9
+ return tokenizer