Spaces:
Sleeping
Sleeping
import os | |
import torch | |
HF_TOKEN = os.getenv('HF_TOKEN') | |
"""T5""" | |
T5_FILE_NAME = "model.safetensors" | |
simplet5_base_URL="angel1987/simplet5_metaphor_dev1" | |
simplet5_large_URL="angel1987/simplet5_metaphor_dev2" | |
"""models""" | |
gemma_2b_URL = "google/gemma-2b-it" | |
Qwen_URL="Qwen/Qwen1.5-0.5B-Chat" | |
falcon_7b_URL = "tiiuae/falcon-7b-instruct" | |
falcon_1b_URL = "tiiuae/falcon-rw-1b" | |
if torch.cuda.is_available(): | |
device_map = "auto" #use GPU if available | |
else: | |
device_map = "cpu" | |
print("No GPU found, using CPU.") | |
TITLE = "LiteraLingo_dev" | |
DESCRIPTION = "Figurative sentences to literal meanings." | |
EXAMPLE = [["gemma", "She has a heart of gold",256], | |
["gemma", "Time flies when you're having fun",128], | |
["falcon_api", "The sky is the limit",200] | |
] | |
gemma_PREFIX="Explain literal meaning of sentence: {fig}, Literal meaning:" | |
falcon_PREFIX="Paraphrase the following sentences from figurative to literal meaning: {fig}" | |
simplet5_PREFIX="Give the literal meaning of the sentence: {fig}" |