File size: 1,360 Bytes
6b0c7a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
import streamlit as st
from app_functions import Get_DialoGPT_Response, Get_DistilGPT_Response, Get_MedGPT_Response  # Importing functions

st.set_page_config(
    page_title="Healthwise AI Assistant",
    page_icon="πŸš‘",
    layout="centered",
    initial_sidebar_state="auto"
)

st.header("Healthwise AI Assistant πŸš‘")

# Input fields
input_text = st.text_input("Enter your prompt here:")

col1, col2, col3 = st.columns(3)

with col1:
    no_words = st.text_input("Max no.of words for better response")

with col2:
    user_type = st.selectbox(
        'Answer for',
        ('Professional', 'Practitioner', 'General'),
        index=0
    )

with col3:
    model_type = st.selectbox(
        'Model Type',
        ('DialoGPT', 'DistilGPT', 'MedGPT'),
        index=0
    )

submit = st.button("Generate Response")

# Generate response
if submit:
    if not input_text or not no_words or not user_type:
        st.error("Please fill in all fields to generate a response.")
    else:
        if model_type == 'DialoGPT':
            response = Get_DialoGPT_Response(input_text, no_words, user_type)
        elif model_type == 'DistilGPT':
            response = Get_DistilGPT_Response(input_text, no_words, user_type)
        else:
            response = Get_MedGPT_Response(input_text, no_words, user_type)
        
        st.write(response)