Update README.md
Browse files
README.md
CHANGED
@@ -66,3 +66,14 @@ from huggingface_hub import notebook_login
|
|
66 |
notebook_login()
|
67 |
model.push_to_hub("your-huggingface-username/custom-gpt")
|
68 |
tokenizer.push_to_hub("your-huggingface-username/custom-gpt")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
notebook_login()
|
67 |
model.push_to_hub("your-huggingface-username/custom-gpt")
|
68 |
tokenizer.push_to_hub("your-huggingface-username/custom-gpt")
|
69 |
+
pip install gradio
|
70 |
+
import gradio as gr
|
71 |
+
from transformers import pipeline
|
72 |
+
|
73 |
+
generator = pipeline("text-generation", model="your-huggingface-username/custom-gpt")
|
74 |
+
|
75 |
+
def chatbot(prompt):
|
76 |
+
return generator(prompt, max_length=100)[0]["generated_text"]
|
77 |
+
|
78 |
+
iface = gr.Interface(fn=chatbot, inputs="text", outputs="text")
|
79 |
+
iface.launch()
|