Spaces:
Running on Zero

nitish17855 commited on
Commit
f96fcc5
·
1 Parent(s): 0f1912f

Configure top-level spaces.GPU and gr.Interface for ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +12 -21
app.py CHANGED
@@ -21,31 +21,22 @@ for pkg in ["punkt", "punkt_tab"]:
21
  except LookupError:
22
  nltk.download(pkg, quiet=True)
23
 
 
24
  import gradio as gr
25
  import uvicorn
26
  from api.main import app
27
 
28
- # ZeroGPU Compatibility Anchor
29
- try:
30
- import spaces
31
-
32
- @spaces.GPU
33
- def zero_gpu_anchor():
34
- return True
35
- except Exception:
36
- def zero_gpu_anchor():
37
- return True
38
-
39
- # Minimal Gradio helper block mounted at /gradio
40
- with gr.Blocks(title="AURA CRAG Studio") as demo:
41
- gr.Markdown("# ⚡ AURA CRAG — Enterprise Financial Intelligence")
42
- gr.Markdown(
43
- "Interactive Glass-Box Studio is active! "
44
- "[**Click here to launch the Full Glass-Box Studio**](/) "
45
- "or access the [**Swagger OpenAPI Docs**](/docs)."
46
- )
47
- _gpu_btn = gr.Button("GPU Check", visible=False)
48
- _gpu_btn.click(fn=zero_gpu_anchor)
49
 
50
  # Mount Gradio onto the existing FastAPI application
51
  # Root '/' continues to serve our custom warm Split-Screen Studio UI!
 
21
  except LookupError:
22
  nltk.download(pkg, quiet=True)
23
 
24
+ import spaces
25
  import gradio as gr
26
  import uvicorn
27
  from api.main import app
28
 
29
+ @spaces.GPU
30
+ def predict(query: str):
31
+ return f"AURA CRAG ZeroGPU Engine Active. Query: {query}"
32
+
33
+ demo = gr.Interface(
34
+ fn=predict,
35
+ inputs=gr.Textbox(label="Enter Financial Query", placeholder="What was Apple's revenue in FY 2025?"),
36
+ outputs=gr.Textbox(label="Status"),
37
+ title="⚡ AURA CRAG — Enterprise Financial Intelligence",
38
+ description="Interactive Glass-Box Studio is active! [Click here to launch the Full Glass-Box Studio](/) or access the [Swagger OpenAPI Docs](/docs)."
39
+ )
 
 
 
 
 
 
 
 
 
 
40
 
41
  # Mount Gradio onto the existing FastAPI application
42
  # Root '/' continues to serve our custom warm Split-Screen Studio UI!