yasserrmd commited on
Commit
6ec5752
·
verified ·
1 Parent(s): b6e9544

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -5,7 +5,7 @@ from threading import Thread
5
  import spaces
6
 
7
  @spaces.GPU
8
- def load_model_tokenizer():
9
  from unsloth import FastLanguageModel
10
  # Model configuration
11
  model_name = "yasserrmd/food_safety"
@@ -21,12 +21,9 @@ def load_model_tokenizer():
21
  load_in_4bit=load_in_4bit,
22
  )
23
  FastLanguageModel.for_inference(model) # Enable faster inference
24
- return model, tokenizer
25
 
26
- model, tokenizer = load_model_tokenizer()
27
 
28
- @spaces.GPU
29
- def food_safety_query(prompt):
30
 
31
  messages = [
32
  {"role": "system", "content": "You are an AI assistant with expertise in food safety. Your primary goal is to provide precise, actionable, and scientifically accurate responses to queries about food safety practices, standards, and regulations. Focus on offering guidance based on global food safety standards, such as HACCP, ISO 22000, and FDA guidelines. Your responses should address hygiene, contamination prevention, food handling, storage, production processes, and safety protocols with practical and specific advice."},
 
5
  import spaces
6
 
7
  @spaces.GPU
8
+ def food_safety_query(prompt):
9
  from unsloth import FastLanguageModel
10
  # Model configuration
11
  model_name = "yasserrmd/food_safety"
 
21
  load_in_4bit=load_in_4bit,
22
  )
23
  FastLanguageModel.for_inference(model) # Enable faster inference
 
24
 
 
25
 
26
+
 
27
 
28
  messages = [
29
  {"role": "system", "content": "You are an AI assistant with expertise in food safety. Your primary goal is to provide precise, actionable, and scientifically accurate responses to queries about food safety practices, standards, and regulations. Focus on offering guidance based on global food safety standards, such as HACCP, ISO 22000, and FDA guidelines. Your responses should address hygiene, contamination prevention, food handling, storage, production processes, and safety protocols with practical and specific advice."},