Spaces:
Running
Running
File size: 404 Bytes
17e2f40 41e4cda 255d92b 41e4cda c5ed979 41e4cda 255d92b c5ed979 41e4cda 255d92b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import subprocess
# 安装单个包
package_name = "flask"
subprocess.check_call(["pip", "install", package_name])
import gradio as gr
from flask import Flask, session
app = Flask(__name__)
def greet(name):
session["user_name"] += name
user_name = session["user_name"]
return "Hello " + user_name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch(app=app) |