File size: 544 Bytes
230a5e9
 
 
 
 
497ea18
e9060de
230a5e9
43834df
79078d6
 
 
 
 
43834df
 
 
 
 
 
0cbdf72
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
#import torch
#from transformers import pipeline
#pipe = pipeline("text-generation", model="keyfan/grok-1-hf", trust_remote_code=True)
#print(pipe("hello?"))

this = gr.load("models/keyfan/grok-1-hf",cache_examples=False)
print(this)
def run_inf(inp):
    try:
        out=this(inp)
    except Exception as e:
        out=e
    return out

with gr.Blocks() as app:
    inp_txt=gr.Textbox()
    btn=gr.Button()
    outp_txt=gr.Textbox()
    btn.click(run_inf,inp_txt,outp_txt)
app.queue(default_concurrency_limit=10).launch()