Spaces:
Runtime error
Runtime error
piyush2102020
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,7 @@ from veronica import Veronica, VeronicaConfig
|
|
13 |
import firebase_admin
|
14 |
import json
|
15 |
from firebase_admin import credentials, db
|
|
|
16 |
import time
|
17 |
from veronica import Veronica # Import Veronica class
|
18 |
|
@@ -21,6 +22,8 @@ from veronica import Veronica # Import Veronica class
|
|
21 |
# Load tokenizer and model
|
22 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
23 |
model = Veronica(VeronicaConfig())
|
|
|
|
|
24 |
model.eval()
|
25 |
firebase_key_path = os.getenv("firebase_db_url")
|
26 |
cred = json.load(os.getenv("firebase_credentials"))
|
|
|
13 |
import firebase_admin
|
14 |
import json
|
15 |
from firebase_admin import credentials, db
|
16 |
+
import torch
|
17 |
import time
|
18 |
from veronica import Veronica # Import Veronica class
|
19 |
|
|
|
22 |
# Load tokenizer and model
|
23 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
24 |
model = Veronica(VeronicaConfig())
|
25 |
+
weights=torch.load("veronica_super_trained.pth",map_location='cpu')
|
26 |
+
model.load_state_dict(weights)
|
27 |
model.eval()
|
28 |
firebase_key_path = os.getenv("firebase_db_url")
|
29 |
cred = json.load(os.getenv("firebase_credentials"))
|