Download Talk2 from Hugorowan/2GPT: direct link, hf CLI and curl.
- Browser
- Download file 518 Bytes
-
https://huggingface.co/spaces/Hugorowan/2GPT/resolve/main/Talk2
- Command line
-
hf download hf://spaces/Hugorowan/2GPT/Talk2
-
curl -L -o Talk2 https://huggingface.co/spaces/Hugorowan/2GPT/resolve/main/Talk2
518 Bytes
| import gradio as gr | |
| import transformers | |
| # Load the GPT-2 model | |
| model_1 = transformers.AutoModelForSequenceClassification.from_pretrained("gpt2-medium") | |
| # Load the GPT-3 model | |
| model_2 = transformers.AutoModelForSequenceClassification.from_pretrained("gpt3-medium") | |
| # Create a Gradio interface | |
| app = gr.Interface( | |
| inputs=[gr.TextInput(label="Enter text")], | |
| outputs=[gr.Output(label="Prediction")], | |
| models=[model_1, model_2], | |
| fn=lambda input, model: model.predict(input), | |
| ) | |
| # Run the app | |
| app.launch() | |