-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update grade examples, add gradio app example
- Loading branch information
Showing
5 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
$operator = PyCore::import("operator"); | ||
$builtins = PyCore::import("builtins"); | ||
$os = PyCore::import('os'); | ||
foreach ($_ENV as $k => $v) { | ||
$os->environ[$k] = $v; | ||
} | ||
$gr = PyCore::import('gradio'); | ||
$demo = $gr->Interface(fn: function ($name, $intensity) { | ||
return str_repeat("Hello ", $intensity) . $name . "!"; | ||
}, inputs: new PyList(["text", "slider"]), outputs: new PyList(["text"])); | ||
$demo->launch(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import gradio as gr | ||
|
||
def greet(name, intensity): | ||
return "Hello " * intensity + name + "!" | ||
|
||
demo = gr.Interface( | ||
fn=greet, | ||
inputs=["text", "slider"], | ||
outputs=["text"], | ||
) | ||
|
||
demo.launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
input 0,input 1,output,flag,username,timestamp | ||
我的世界,6,Hello Hello Hello Hello Hello Hello 我的世界!,,,2024-01-26 16:44:04.555180 | ||
我的世界,6,Hello Hello Hello Hello Hello Hello 我的世界!,,,2024-01-26 16:44:06.572989 | ||
我的世界,6,Hello Hello Hello Hello Hello Hello 我的世界!,,,2024-01-26 16:44:16.036929 |