i0xs0 commited on
Commit
b63ce0a
·
verified ·
1 Parent(s): 83b1735

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -2,15 +2,13 @@ import gradio as gr
2
  from transformers import pipeline
3
  import os
4
 
5
- model = pipeline("text-classification", model="i0xs0/Text_Classifiction_V2", tokenizer="i0xs0/Text_Classifiction_V2")
 
6
 
7
- if not os.path.exists(".logs"):
8
- os.makedirs(".logs")
9
 
10
  def predict_emotion(text):
11
 
12
- with open(".logs/user_logs.txt", "a") as log_file:
13
- log_file.write(f"User input: {text}\n")
14
  results = model(text)
15
  return {item["label"]: item["score"] for item in results}
16
 
 
2
  from transformers import pipeline
3
  import os
4
 
5
+ model = pipeline("text-classification", model="i0xs0/Text_Classification_V2", tokenizer="i0xs0/Text_Classification_V2")
6
+
7
 
 
 
8
 
9
  def predict_emotion(text):
10
 
11
+
 
12
  results = model(text)
13
  return {item["label"]: item["score"] for item in results}
14