pragnakalp commited on
Commit
b457150
1 Parent(s): f0ed851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -21,6 +21,21 @@ model_path = os.path.join(cwd)
21
  tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
22
  model_base = AutoModelWithLMHead.from_pretrained(model_path)
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  def get_emotion(text):
25
 
26
  # input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
 
21
  tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-emotion")
22
  model_base = AutoModelWithLMHead.from_pretrained(model_path)
23
 
24
+ try:
25
+ hf_hub_download(
26
+ repo_id=DATASET_REPO_ID,
27
+ filename=DATA_FILENAME,
28
+ cache_dir=DATA_DIRNAME,
29
+ force_filename=DATA_FILENAME
30
+ )
31
+
32
+ except:
33
+ print("file not found")
34
+
35
+ repo = Repository(
36
+ local_dir="que_gen_logs", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
37
+ )
38
+
39
  def get_emotion(text):
40
 
41
  # input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')