AmithAdiraju1694's picture
feat_preo_cmod (#3)
2a12b77 verified
raw
history blame contribute delete
877 Bytes
import torch
import re
model_inf_inp_prompt = "INSTRUCTION: given food item name, explain these things:(major ingredients,making process,portion & spicy/sweet,pairs with,allergens,food type(veg/non-veg/vegan)). ensure to get allergens and food category factually correct.Item Name: {} "
header_pattern = r'Item Name: (.*?)\. Major Ingredients: (.*?)\. Making Process: (.*?)\. Portion and Spice Level: (.*?)\. Pairs With: (.*?)\. Allergens: (.*?)\. Food Type: (.*?)\.\s*</s>'
dots_pattern = re.compile(r'\.{3,}')
DEBUG_MODE = True
model_name = "AmithAdiraju1694/gpt-neo-125M_menuitemexp"
def get_device():
if torch.cuda.is_available():
device = torch.device("cuda")
print(f"Using GPU: {torch.cuda.get_device_name(0)}") #get the name of the GPU being used.
else:
device = torch.device("cpu")
print("Using CPU")
return device
DEVICE = get_device()