|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
model = pipeline("question-answering", model="Rishitha0208/new-llm-for-advanced-materials") |
|
|
|
def answer_question(question): |
|
|
|
result = model(question=question, context="") |
|
return result['answer'] |
|
|
|
|
|
interface = gr.Interface( |
|
fn=answer_question, |
|
inputs=gr.Textbox(lines=2, placeholder="Enter your question here...", label="Question"), |
|
outputs="text", |
|
title="Polymer Knowledge Model", |
|
description="A model fine-tuned to answer questions about polymers." |
|
) |
|
|
|
|
|
interface.launch() |
|
|