File size: 858 Bytes
13b7677
a3a4a49
73b954d
 
13b7677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3a4a49
 
 
 
 
73b954d
 
13b7677
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
import streamlit as st
import gradio as gr

def main():
    # Set up the page
    st.set_page_config(page_title="Nudge Generator - Gemma 2b", page_icon="orYx logo.png", layout="wide")

    # Title and logo
    col1, col2 = st.columns([3, 1])
    with col1:
        st.title("Nudge Generator - Gemma 2b")
    with col2:
        st.image("orYx logo.png", use_column_width=True)

    # Chat interface
    st.markdown("---")
    st.header("Chat Interface")

    # Input for user-provided data
    prompt = st.text_area("Enter the prompt here:")

    # Load model with Gradio
    if st.button("Load and Launch Model"):
        with st.spinner("Launching model..."):
            gr.load("models/google/gemma-2-2b-it").launch()
            st.success("Model launched successfully! Access it in the new tab opened by Gradio.")

if __name__ == "__main__":
    main()