CosmoAI commited on
Commit
37828da
·
1 Parent(s): 93c7b85

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +10 -5
Home.py CHANGED
@@ -2,7 +2,8 @@ import streamlit as st
2
  from streamlit_option_menu import option_menu
3
  from transformers import pipeline, Conversation
4
 
5
- pipe = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
 
6
 
7
 
8
  # def homepage():
@@ -20,14 +21,18 @@ pipe = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
20
  def chat():
21
  if query := st.chat_input("Enter your message"):
22
  uquery = Conversation(query)
23
- response = pipe(uquery)
24
  with st.chat_message("assistant"):
25
  st.write(response.generated_responses[-1])
26
 
27
 
28
- # def invoke_document():
29
- # st.write("Invoke Document")
30
- # st.write("Welcome to the invoke document page")
 
 
 
 
31
 
32
  # def invoke_audio():
33
  # st.write("Invoke Audio")
 
2
  from streamlit_option_menu import option_menu
3
  from transformers import pipeline, Conversation
4
 
5
+ convo = pipeline(task="conversational", model="microsoft/DialoGPT-medium")
6
+ imgclassifier = pipeline(model="microsoft/beit-base-patch16-224-pt22k-ft22k")
7
 
8
 
9
  # def homepage():
 
21
  def chat():
22
  if query := st.chat_input("Enter your message"):
23
  uquery = Conversation(query)
24
+ response = convo(uquery)
25
  with st.chat_message("assistant"):
26
  st.write(response.generated_responses[-1])
27
 
28
 
29
+ def image_classifi():
30
+ with st.sidebar:
31
+ file = st.file_uploader("Upload Image", ["png", "jpg"])
32
+ output = imgclassifier(file)
33
+ if st.button("View Results"):
34
+ st.write(output)
35
+
36
 
37
  # def invoke_audio():
38
  # st.write("Invoke Audio")