File size: 511 Bytes
fd47a53
 
 
 
 
a911913
fd47a53
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import transformers_gradio

# CPU環境のため spaces.GPU() は削除
try:
    demo = gr.load(name="lxcorp/Link-270M-GGUF", src=transformers_gradio.registry)
except Exception as e:
    print(f"Loading error: {e}")
    # ロードに失敗しても、llama.cppサーバーが裏で動く
    demo = gr.Interface(fn=lambda x: f"Loading: {e}", inputs="text", outputs="text")

# API名を隠す
for fn in demo.fns.values():
    fn.api_name = False

if __name__ == "__main__":
    demo.launch()