|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
|
|
model1 = pipeline("text-generation", model="thrishala/mental_health_chatbot") |
|
|
|
|
|
model2 = pipeline("text-generation", model="thrishala/mental_health_chatbot") |
|
|
|
|
|
def compare_models(input_text): |
|
response1 = model1(input_text, max_length=100)[0]["generated_text"] |
|
response2 = model2(input_text, max_length=100)[0]["generated_text"] |
|
return response1, response2 |
|
|
|
|
|
iface = gr.Interface(fn=compare_models, |
|
inputs="text", |
|
outputs=["text", "text"], |
|
live=True, |
|
title="Mental Health Chatbot Comparison", |
|
description="Compare responses from two different Mental Health Chatbot models") |
|
|
|
|
|
iface.launch() |
|
|