Update app.py
Browse files37 unmodified lines3839404142434437 unmodified linestry:response = model_component(payload) # The response is likely a dictionaryif isinstance(response, dict) and "choices" in response:assistant_response = response["choices"][0]["message"]["content"]else:assistant_response = "Unexpected model response format."except Exception as e:37 unmodified lines383940414243444546474837 unmodified linestry:response = model_component(payload) # The response is likely a dictionaryif isinstance(response, dict) and "choices" in response:# Assuming the response structure is similar to OpenAI's APIassistant_response = response["choices"][0]["message"]["content"]elif isinstance(response, dict) and "generated_text" in response:# If the response is in a different format, adjust accordinglyassistant_response = response["generated_text"]else:assistant_response = "Unexpected model response format."except Exception as e:
app.py+4