adi-123 commited on
Commit
33ee975
1 Parent(s): e7bd9fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -37,13 +37,14 @@ def txt2story(img_text):
37
  print("Story...")
38
  chat_completion = client.chat.completions.create(
39
  messages=messages,
 
 
 
40
  model="togethercomputer/llama-2-70b-chat")
41
 
42
  print(chat_completion.choices[0].message.content)
43
  return chat_completion.choices[0].message.content
44
 
45
-
46
-
47
  # Text-to-speech
48
  def txt2speech(text):
49
  print("Initializing text-to-speech conversion...")
@@ -65,6 +66,11 @@ def main():
65
  # Allows users to upload an image file
66
  uploaded_file = st.file_uploader("# 📷 Upload an image...", type=["jpg", "jpeg", "png"])
67
 
 
 
 
 
 
68
  if uploaded_file is not None:
69
  # Reads and saves uploaded image file
70
  bytes_data = uploaded_file.read()
 
37
  print("Story...")
38
  chat_completion = client.chat.completions.create(
39
  messages=messages,
40
+ "top_k": top_k,
41
+ "top_p": top_p,
42
+ "temperature": temperature,
43
  model="togethercomputer/llama-2-70b-chat")
44
 
45
  print(chat_completion.choices[0].message.content)
46
  return chat_completion.choices[0].message.content
47
 
 
 
48
  # Text-to-speech
49
  def txt2speech(text):
50
  print("Initializing text-to-speech conversion...")
 
66
  # Allows users to upload an image file
67
  uploaded_file = st.file_uploader("# 📷 Upload an image...", type=["jpg", "jpeg", "png"])
68
 
69
+ # Parameters for LLM model (in the sidebar)
70
+ top_k = st.sidebar.number_input("Top-K", min_value=1, max_value=100, value=5)
71
+ top_p = st.sidebar.number_input("Top-P", min_value=0.0, max_value=1.0, value=0.4)
72
+ temperature = st.sidebar.number_input("Temperature", min_value=0.1, max_value=2.0, value=1.0)
73
+
74
  if uploaded_file is not None:
75
  # Reads and saves uploaded image file
76
  bytes_data = uploaded_file.read()