ChrisMofus commited on
Commit
d979bb9
1 Parent(s): 1d55ece

Add story display

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -26,11 +26,15 @@ if uploaded_file is not None:
26
  enc_image = model.encode_image(image)
27
  answer = model.answer_question(enc_image, "Describe this image in a few sentences.", tokenizer)
28
 
29
- st.write(answer)
 
30
 
31
  model_id = "meta-llama/Meta-Llama-3-8B"
32
 
33
  pipeline = transformers.pipeline("text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map="auto")
34
 
35
- pipeline("Generate a short story based on image description: " + answer)
 
 
 
36
 
 
26
  enc_image = model.encode_image(image)
27
  answer = model.answer_question(enc_image, "Describe this image in a few sentences.", tokenizer)
28
 
29
+ st.header("Image Description Generated.")
30
+ st.success(answer)
31
 
32
  model_id = "meta-llama/Meta-Llama-3-8B"
33
 
34
  pipeline = transformers.pipeline("text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map="auto")
35
 
36
+ story = pipeline("Generate a short story based on image description: " + answer)
37
+
38
+ st.header("Story Generated.")
39
+ st.success(story)
40