rebekah0302 commited on
Commit
c92298e
verified
1 Parent(s): 8a17538

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -0
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()