Spaces:
Sleeping
Sleeping
Angelawork
commited on
Commit
·
7222a6a
1
Parent(s):
38b2666
global variables
Browse files- globals.py +31 -0
globals.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import torch
|
3 |
+
HF_TOKEN = os.getenv('HF_TOKEN')
|
4 |
+
|
5 |
+
"""T5"""
|
6 |
+
T5_FILE_NAME = "model.safetensors"
|
7 |
+
simplet5_base_URL="angel1987/simplet5_metaphor_dev1"
|
8 |
+
simplet5_large_URL="angel1987/simplet5_metaphor_dev2"
|
9 |
+
|
10 |
+
"""models"""
|
11 |
+
gemma_2b_URL = "google/gemma-2b-it"
|
12 |
+
Qwen_URL="Qwen/Qwen1.5-0.5B-Chat"
|
13 |
+
falcon_7b_URL = "tiiuae/falcon-7b-instruct"
|
14 |
+
falcon_1b_URL = "tiiuae/falcon-rw-1b"
|
15 |
+
|
16 |
+
if torch.cuda.is_available():
|
17 |
+
device_map = "auto" #use GPU if available
|
18 |
+
else:
|
19 |
+
device_map = "cpu"
|
20 |
+
print("No GPU found, using CPU.")
|
21 |
+
|
22 |
+
TITLE = "LiteraLingo_dev"
|
23 |
+
DESCRIPTION = "Figurative sentences to literal meanings."
|
24 |
+
|
25 |
+
EXAMPLE = [["gemma", "She has a heart of gold",256],
|
26 |
+
["gemma", "Time flies when you're having fun",128],
|
27 |
+
["falcon_api", "The sky is the limit",200]
|
28 |
+
]
|
29 |
+
gemma_PREFIX="Explain literal meaning of sentence: {fig}, Literal meaning:"
|
30 |
+
falcon_PREFIX="Paraphrase the following sentences from figurative to literal meaning: {fig}"
|
31 |
+
simplet5_PREFIX="Give the literal meaning of the sentence: {fig}"
|