import gradio from os import system system("pip3 install torch") system("pip3 install transformers") from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("openai-community/openai-gpt") def work(inp_text): out = "hello" out = tokenizer.encode(hello) return str(out) demo = gradio.Interface( fn=work, inputs=["text"], outputs=["text"], ) demo.launch()