Spaces:
Sleeping
Sleeping
victor
commited on
Commit
·
1f8f6b8
1
Parent(s):
0099c22
local path added join
Browse files
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
import torch
|
|
|
4 |
|
5 |
# load model
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
|
9 |
|
10 |
# Define the inference function
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
import torch
|
4 |
+
import os
|
5 |
|
6 |
# load model
|
7 |
+
model_path = os.path.join(os.getcwd(), "review_analysis/output")
|
8 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_path, local_files_only=True)
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, local_files_only=True)
|
10 |
+
|
11 |
|
12 |
|
13 |
# Define the inference function
|