hruday96 commited on
Commit
58905ee
1 Parent(s): 6e96ded

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -29
app.py CHANGED
@@ -1,13 +1,5 @@
1
  import streamlit as st
2
- from transformers import pipeline
3
-
4
- # Set up the LLaMA 3.2 model (using Hugging Face pipeline)
5
- @st.cache_resource
6
- def load_llama_model():
7
- return pipeline('text-generation', model='meta-llama/Llama-3.2-7b-hf')
8
-
9
- # Load the model
10
- llama_generator = load_llama_model()
11
 
12
  # Streamlit app layout
13
  st.title('Personalized Product Description Writer')
@@ -18,26 +10,6 @@ product_name = st.text_input('Product Name', '')
18
  product_features = st.text_area('Product Features (comma separated)', '')
19
  target_audience = st.text_input('Target Audience', '')
20
 
21
- # Button to trigger the description generation
22
- if st.button('Generate Description'):
23
- if product_name and product_features and target_audience:
24
- # Construct the prompt for the LLaMA model
25
- prompt = (f"Write a product description for a product called '{product_name}' targeting {target_audience}. "
26
- f"Features include: {product_features}.")
27
-
28
- # Generate the description using LLaMA 3.2 model
29
- description = llama_generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
30
-
31
- # Display the generated description
32
- st.subheader("Generated Product Description:")
33
- st.write(description)
34
- else:
35
- st.warning("Please fill in all the fields.")
36
-
37
- # Additional optional features
38
- st.sidebar.subheader("Customize Description")
39
- length = st.sidebar.slider('Max Length', 50, 200, 100)
40
-
41
  # Footer
42
  st.sidebar.markdown("---")
43
  st.sidebar.markdown("Built with 🧠 by Hruday & Ollama")
 
1
  import streamlit as st
2
+ import google.generativeai as genai
 
 
 
 
 
 
 
 
3
 
4
  # Streamlit app layout
5
  st.title('Personalized Product Description Writer')
 
10
  product_features = st.text_area('Product Features (comma separated)', '')
11
  target_audience = st.text_input('Target Audience', '')
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  # Footer
14
  st.sidebar.markdown("---")
15
  st.sidebar.markdown("Built with 🧠 by Hruday & Ollama")