Navyabhat commited on
Commit
cfc8853
Β·
verified Β·
1 Parent(s): 0737966

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -36
app.py CHANGED
@@ -69,49 +69,35 @@ def run(history, text, image, audio_upload, audio_mic):
69
  with gr.Blocks() as demo:
70
  gr.Markdown("## MulitModal Phi2 Model Pretraining and Finetuning from Scratch")
71
 
72
- # with gr.Row():
73
- # with gr.Column(scale=4):
74
- # # Creating a column with a scale of 6
75
- # with gr.Box():
76
- # with gr.Row():
77
- # # Adding image
78
- # image = gr.Image(type="filepath", value=None)
79
- # # Creating a column with a scale of 2
80
- # with gr.Row():
81
- # # Add audio
82
- # audio_upload = gr.Audio(source="upload", type="filepath")
83
- # audio_mic = gr.Audio(
84
- # source="microphone", type="filepath", format="mp3"
85
- # )
86
-
87
- # with gr.Column(scale=8):
88
- with gr.Box():
89
- with gr.Row():
90
- chatbot = gr.Chatbot(
91
- avatar_images=("πŸ§‘", "πŸ€–"),
92
- height=560,
93
- )
94
 
95
  with gr.Row():
96
  # Adding a Textbox with a placeholder "write prompt"
97
  prompt = gr.Textbox(
98
  placeholder="Ask anything", lines=2, label="Query", value=None, scale=4
99
  )
100
-
101
- upload_btn = gr.UploadButton("πŸ“", file_types=["image", "audio"])
102
 
103
- with gr.Row():
104
- if upload_btn.files is not None and len(upload_btn.files) > 0:
105
- file_path = upload_btn.files[0].name
106
- image = gr.Image(file_path, type="filepath")
107
- audio_upload = gr.Audio(file_path, source="upload", type="filepath")
108
- else:
109
- image = gr.Image(type="filepath", value=None)
110
- audio_upload = gr.Audio(source="upload", type="filepath")
111
-
112
- audio_mic = gr.Audio(
113
- source="microphone", type="filepath", format="mp3"
114
- )
115
 
116
  with gr.Row():
117
  # Adding a Button
 
69
  with gr.Blocks() as demo:
70
  gr.Markdown("## MulitModal Phi2 Model Pretraining and Finetuning from Scratch")
71
 
72
+ with gr.Row():
73
+ with gr.Column(scale=4):
74
+ # Creating a column with a scale of 6
75
+ with gr.Box():
76
+ with gr.Row():
77
+ # Adding image
78
+ image = gr.Image(type="filepath", value=None)
79
+ # Creating a column with a scale of 2
80
+ with gr.Row():
81
+ # Add audio
82
+ audio_upload = gr.Audio(source="upload", type="filepath")
83
+ audio_mic = gr.Audio(
84
+ source="microphone", type="filepath", format="mp3"
85
+ )
86
+
87
+ with gr.Column(scale=8):
88
+ with gr.Box():
89
+ with gr.Row():
90
+ chatbot = gr.Chatbot(
91
+ avatar_images=("πŸ§‘", "πŸ€–"),
92
+ height=560,
93
+ )
94
 
95
  with gr.Row():
96
  # Adding a Textbox with a placeholder "write prompt"
97
  prompt = gr.Textbox(
98
  placeholder="Ask anything", lines=2, label="Query", value=None, scale=4
99
  )
 
 
100
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  with gr.Row():
103
  # Adding a Button