objects76 commited on
Commit
5162826
Β·
verified Β·
1 Parent(s): 8456bda

Uploading FoodExtract demo app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -42,8 +42,6 @@ tokenizer = AutoTokenizer.from_pretrained(
42
  # device_map="auto",
43
  # attn_implementation="eager"
44
  # )
45
- #
46
- # # Create model pipeline
47
  # loaded_model_pipeline = pipeline("text-generation",
48
  # model=loaded_model,
49
  # tokenizer=tokenizer)
@@ -59,12 +57,12 @@ loaded_model_pipeline = pipeline(
59
 
60
 
61
  # Create the demo
62
- description = """Extract food and drink items from text with a fine-tuned SLM (Small Language Model) or more specifically a fine-tuned [Gemma 3 270M](https://huggingface.co/google/gemma-3-270m-it).
 
 
63
 
64
- Our model has been fine-tuned on the [FoodExtract-1k dataset](https://huggingface.co/datasets/objects76/FoodExtract-1k).
65
-
66
- * Input (str): Raw text strings or image captions (e.g. "A photo of a dog sitting on a beach" or "A breakfast plate with bacon, eggs and toast")
67
- * Output (str): Generated text with food/not_food classification as well as noun extracted food and drink items and various food tags.
68
 
69
  For example:
70
 
@@ -87,7 +85,7 @@ demo = gr.Interface(fn=pred_on_text,
87
  title="🍳 Structured FoodExtract with a Fine-Tuned Gemma 3 270M",
88
  description=description,
89
  examples=[["Hello world! This is my first fine-tuned LLM!"],
90
- ["A plate of food with grilled barramundi, salad with avocado, olives, tomatoes and Italian dressing"],
91
  ["British Breakfast with baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, a cup of tea and toast and fried tomatoes"],
92
  ["Steak tacos"],
93
  ["A photo of a dog sitting on a beach"]]
 
42
  # device_map="auto",
43
  # attn_implementation="eager"
44
  # )
 
 
45
  # loaded_model_pipeline = pipeline("text-generation",
46
  # model=loaded_model,
47
  # tokenizer=tokenizer)
 
57
 
58
 
59
  # Create the demo
60
+ description = """ν…μŠ€νŠΈμ—μ„œ μŒμ‹κ³Ό 음료 ν•­λͺ©μ„ μΆ”μΆœν•˜λŠ” νŒŒμΈνŠœλ‹λœ SLM(Small Language Model)
61
+ - basemodel: [Gemma 3 270M](https://huggingface.co/google/gemma-3-270m-it)
62
+ - dataset: [FoodExtract-1k 데이터셋](https://huggingface.co/datasets/objects76/FoodExtract-1k)
63
 
64
+ * μž…λ ₯ (str): μ›μ‹œ ν…μŠ€νŠΈ λ¬Έμžμ—΄ λ˜λŠ” 이미지 μΊ‘μ…˜ (예: "ν•­ν•΄ 앉아 μžˆλŠ” 개의 사진" λ˜λŠ” "베이컨, κ³„λž€, ν† μŠ€νŠΈκ°€ μžˆλŠ” μ•„μΉ¨ 식사")
65
+ * 좜λ ₯ (str): μŒμ‹/λΉ„μŒμ‹ λΆ„λ₯˜μ™€ μΆ”μΆœλœ λͺ…μ‚¬ν˜• μŒμ‹ 및 음료 ν•­λͺ©, λ‹€μ–‘ν•œ μŒμ‹ νƒœκ·Έκ°€ ν¬ν•¨λœ 생성 ν…μŠ€νŠΈ
 
 
66
 
67
  For example:
68
 
 
85
  title="🍳 Structured FoodExtract with a Fine-Tuned Gemma 3 270M",
86
  description=description,
87
  examples=[["Hello world! This is my first fine-tuned LLM!"],
88
+ ["그릴에 ꡬ운 바라문디와 아보카도, 올리브, ν† λ§ˆν† , μ΄νƒˆλ¦¬μ•ˆ λ“œλ ˆμ‹±μ΄ 곁듀여진 μƒλŸ¬λ“œκ°€ μžˆλŠ” ν•œ μ ‘μ‹œ μŒμ‹"],
89
  ["British Breakfast with baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, a cup of tea and toast and fried tomatoes"],
90
  ["Steak tacos"],
91
  ["A photo of a dog sitting on a beach"]]