| import gradio as gr | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| # Load the model and tokenizer | |
| model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B") | |
| tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B") | |
| # Define the prediction function | |
| def predict(text): | |
| #app = text + " Is it false or true? Fact check it and provide the supporting reason." | |
| inputs = tokenizer(text, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=100) | |
| return tokenizer.decode(outputs[0], skip_special_tokens=True) | |
| # Define Gradio Interface | |
| iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="TrueGL Search Engine") | |
| # Launch the app | |
| iface.launch() |