viv commited on
Commit
c3b1f27
·
verified ·
1 Parent(s): 0b31a54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,12 +2,12 @@ import gradio as gr
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
4
 
5
- # Load the trained model and tokenizer
6
- model_path = 'viv/AIKIA/pytorch_model.bin' # Path to the .bin file
7
- tokenizer = AutoTokenizer.from_pretrained("nlpaueb/bert-base-greek-uncased-v1")
8
 
9
- # Directly load the model from the .bin file
10
- model = AutoModelForSequenceClassification.from_pretrained(model_path, from_tf=False, config='viv/AIKIA/config.json')
11
 
12
  # Preprocessing function for Greek text
13
  def preprocessing_greek(text):
 
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
4
 
5
+ # Load the model and tokenizer from Hugging Face Hub
6
+ model_path = 'viv/AIKIA' # Hugging Face model ID
7
+ tokenizer = AutoTokenizer.from_pretrained(model_path) # Tokenizer from Hugging Face
8
 
9
+ # Load the model from Hugging Face repository
10
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
11
 
12
  # Preprocessing function for Greek text
13
  def preprocessing_greek(text):