Atheer174 commited on
Commit
de789a2
·
1 Parent(s): cd1ec44
Files changed (4) hide show
  1. .env +1 -0
  2. 1.jpg +0 -0
  3. app.py +32 -11
  4. screen-1.png +0 -0
.env ADDED
@@ -0,0 +1 @@
 
 
1
+ OPENAI_API_KEY=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
1.jpg ADDED
app.py CHANGED
@@ -114,24 +114,46 @@ with gr.Blocks() as app:
114
 
115
  # Define the layout using the Tabs
116
  with gr.Tab("Damage Assessment"):
117
- gr.Markdown('## Evaluate vehicle damage and estimate repair costs by inputting vehicle details and uploading an image of the damage. Receive a comprehensive repair estimate.')
118
- make_input = gr.Textbox(label="Make")
119
- model_input = gr.Textbox(label="Model")
120
- year_input = gr.Textbox(label="Year")
121
- image_input = gr.Image(label="Upload Image")
 
 
 
 
 
 
 
 
 
122
  vehicle_output = gr.Textbox(label="Estimation Report")
123
- vehicle_button = gr.Button("Assess")
 
 
124
 
 
 
 
 
 
 
 
 
 
125
 
126
  with gr.Tab("Repair Pal Chat"):
127
- gr.Markdown('## chat with our Repair Pal about your car problem')
 
 
128
 
129
  system_message = {"role": "system", "content": "You are a helpful assistant."}
130
  chatbot = gr.Chatbot()
131
  msg = gr.Textbox(label='write your problem')
132
  clear = gr.Button("Clear")
133
 
134
- state = gr.State([])
135
 
136
  def user(user_message, history):
137
  return "", history + [[user_message, None]]
@@ -191,8 +213,7 @@ with gr.Blocks() as app:
191
 
192
 
193
  # Link the button click to the vehicle assessment function
194
- vehicle_button.click(vehicle_assessment, inputs=[make_input, model_input, year_input, image_input], outputs=vehicle_output)
195
  # chat_button.click(chat_with_bot, inputs=[chat_input], outputs=chat_output)
196
-
197
-
198
  app.launch()
 
114
 
115
  # Define the layout using the Tabs
116
  with gr.Tab("Damage Assessment"):
117
+ gr.Markdown("""##
118
+ After Saleh's car was rear-ended. He had flashbacks to previous times this has happened,
119
+ remembering the hassle of calls, and the struggle to find a good repair shop. But now all
120
+ that is in the past, with Misbah Garage app, he easily knew how much repairs would cost, and got linked to a
121
+ trustworthy repair shop. """
122
+ )
123
+ examples = [
124
+ ["Toyota", "fortuner", "2019", "/Users/atheer/Desktop/Misbah/mycarsapp/1.jpg"]
125
+ ]
126
+
127
+ make_input = gr.Textbox(label="Make", interactive = False)
128
+ model_input = gr.Textbox(label="Model", interactive = False)
129
+ year_input = gr.Textbox(label="Year", interactive = False)
130
+ image_input = gr.Image(label="Click on the example below", type="numpy", interactive = False, width=400, height=400)
131
  vehicle_output = gr.Textbox(label="Estimation Report")
132
+ gr.Examples(examples=examples, inputs=[make_input, model_input, year_input, image_input], outputs=vehicle_output)
133
+ vehicle_button = gr.Button("Inspect")
134
+ # Define the examples component
135
 
136
+ with gr.Tab("Find a repair shop"):
137
+ gr.Markdown('## Sarah experienced her car shaking when braking. She used Misbah Garage app, described the issue, and immediately got a diagnosis with a cost estimate. The app then directed her to a nearby shop specializing in her car\'s issue, streamlining the repair process.')
138
+ gr.Markdown(
139
+ '<div style="display: inline-block;width: 100%;">'
140
+ '<img class="img-fluid AnimatedLogo" alt="misbah logo icons" title="misbah logo icons" src="/Users/atheer/Desktop/Misbah/mycarsapp/1.jpg">'
141
+ '</div>'
142
+ )
143
+ gr.Image(type="pil", value='/Users/atheer/Desktop/Misbah/mycarsapp/screen-1.png', width=300, height=600)
144
+
145
 
146
  with gr.Tab("Repair Pal Chat"):
147
+ gr.Markdown("""
148
+ Khalid bought a new car and wanted to learn the best maintenance practices.Through Misbah Garage app, he was able to find comprehensive answers to all his car maintenance questions, significantly expanding his knowledge about caring for his vehicle
149
+ """)
150
 
151
  system_message = {"role": "system", "content": "You are a helpful assistant."}
152
  chatbot = gr.Chatbot()
153
  msg = gr.Textbox(label='write your problem')
154
  clear = gr.Button("Clear")
155
 
156
+ state = gr.State([])g
157
 
158
  def user(user_message, history):
159
  return "", history + [[user_message, None]]
 
213
 
214
 
215
  # Link the button click to the vehicle assessment function
216
+ # vehicle_button.click(vehicle_assessment, inputs=[make_input, model_input, year_input, image_input], outputs=vehicle_output)
217
  # chat_button.click(chat_with_bot, inputs=[chat_input], outputs=chat_output)
218
+ vehicle_button.click(vehicle_assessment, inputs=[make_input, model_input, year_input, image_input], outputs=vehicle_output)
 
219
  app.launch()
screen-1.png ADDED