Electricarchmage commited on
Commit
4f7c840
·
1 Parent(s): 51f9043

added space code

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from peft import PeftModel, PeftConfig
3
+ from transformers import AutoModelForCausalLM
4
+
5
+ config = PeftConfig.from_pretrained("Electricarchmage/ApocryphaGenerator")
6
+ model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b")
7
+ model = PeftModel.from_pretrained(model, "Electricarchmage/ApocryphaGenerator")
8
+
9
+ apocrypha_gen = gr.Interface.load("Electricarchmage/ApocryphaGenerator")
10
+ description = "Generate Apocrypha (just fyi this thing pulls up all 20 billion parameters in the model as it executes here, so you might be here for a while)"
11
+ title = "Apocrypha Generator using GPT-NeoX-20b"
12
+ examples[["Some apocrypha about Noah's Ark: "]]
13
+
14
+ Series(description = description, title = title, inputs = gr.inputs.Textbox(lines = 10)).launch()