add index file
Browse files- app.py +26 -2
- templates/index.html +10 -0
app.py
CHANGED
@@ -1,7 +1,31 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(name):
|
4 |
return "Hello, are you" + name + "?"
|
5 |
|
6 |
-
|
7 |
-
iface.
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import io
|
3 |
+
import base64
|
4 |
+
from flask import Flask, render_template, request, send_file, jsonify
|
5 |
+
import torch
|
6 |
+
import json
|
7 |
+
from PIL import Image
|
8 |
+
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
9 |
+
import threading
|
10 |
+
import requests
|
11 |
+
|
12 |
+
def load_app_config():
|
13 |
+
global appConfig
|
14 |
+
try:
|
15 |
+
with open('appConfig.json', 'r') as f:
|
16 |
+
appConfig = json.load(f)
|
17 |
+
except FileNotFoundError:
|
18 |
+
print("App config file not found.")
|
19 |
+
except json.JSONDecodeError:
|
20 |
+
print("Error decoding JSON in app config file.")
|
21 |
+
except Exception as e:
|
22 |
+
print("An error occurred while loading app config:", str(e))
|
23 |
+
|
24 |
+
load_app_config()
|
25 |
|
26 |
def greet(name):
|
27 |
return "Hello, are you" + name + "?"
|
28 |
|
29 |
+
if __name__ == '__main__':
|
30 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
31 |
+
iface.launch()
|
templates/index.html
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>pictero</title>
|
7 |
+
</head>
|
8 |
+
<html>
|
9 |
+
|
10 |
+
</html>
|