supertv commited on
Commit
c9f5995
1 Parent(s): 202ec55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -25
app.py CHANGED
@@ -5,30 +5,6 @@ import transformers
5
  import torch
6
 
7
 
8
- def falcon(input_text):
9
- model = "tiiuae/falcon-40b"
10
 
11
- tokenizer = AutoTokenizer.from_pretrained(model)
12
- pipeline = transformers.pipeline(
13
- "text-generation",
14
- model=model,
15
- tokenizer=tokenizer,
16
- torch_dtype=torch.bfloat16,
17
- trust_remote_code=True,
18
- device_map="auto",
19
- )
20
- sequences = pipeline(
21
- input_text, # "你吃饭了吗?"
22
- max_length=200,
23
- do_sample=True,
24
- top_k=10,
25
- num_return_sequences=1,
26
- eos_token_id=tokenizer.eos_token_id,
27
- )
28
- for seq in sequences:
29
- print(f"Result: {seq['generated_text']}")
30
 
31
- return sequences[0]['generated_text']
32
-
33
- iface = gr.Interface(fn=falcon, inputs="text", outputs="text")
34
- iface.launch() # To create a public link, set `share=True`
 
5
  import torch
6
 
7
 
 
 
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ gr.Interface.load("models/radames/stable-diffusion-v1-5-img2img").launch()