File size: 486 Bytes
1911cc4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import os
import subprocess
import gradio as gr
# Kompilasi C++ saat pertama kali dijalankan
if not os.path.exists("jellyfishnet"):
os.system("g++ infer.cpp -o jellyfishnet")
def run_cpp(prompt):
result = subprocess.run(
["./jellyfishnet"],
input=prompt.encode(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
return result.stdout.decode()
gr.Interface(fn=run_cpp, inputs="text", outputs="text", title="JellyfishNet 🪼").launch()
|