Spaces:
Sleeping
Sleeping
Ahmed Samir Nagy Mohammed commited on
Commit ·
ff85a59
1
Parent(s): fd672ec
Fix Python 3.9 compatibility - use Optional instead of union operator for type hints
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from fastapi import FastAPI, Body, HTTPException
|
| 3 |
from pydantic import BaseModel, Field
|
| 4 |
-
from typing import List, Dict, Any
|
| 5 |
import time
|
| 6 |
import numpy as np
|
| 7 |
import random
|
|
@@ -120,7 +120,7 @@ def call_mock_dgm_self_improve(current_prompt: str, failure_analysis: str) -> st
|
|
| 120 |
suggestion = random.choice(suggestions)
|
| 121 |
return f"{current_prompt}\n\n{suggestion}\n# Justification: {failure_analysis}"
|
| 122 |
|
| 123 |
-
def extract_final_vector_from_trace(agent_trace: list) -> np.ndarray
|
| 124 |
"""Parses the final vector string from a mock agent trace."""
|
| 125 |
try:
|
| 126 |
# In our mock, the verifier's output contains the final vector preview
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from fastapi import FastAPI, Body, HTTPException
|
| 3 |
from pydantic import BaseModel, Field
|
| 4 |
+
from typing import List, Dict, Any, Optional
|
| 5 |
import time
|
| 6 |
import numpy as np
|
| 7 |
import random
|
|
|
|
| 120 |
suggestion = random.choice(suggestions)
|
| 121 |
return f"{current_prompt}\n\n{suggestion}\n# Justification: {failure_analysis}"
|
| 122 |
|
| 123 |
+
def extract_final_vector_from_trace(agent_trace: list) -> Optional[np.ndarray]:
|
| 124 |
"""Parses the final vector string from a mock agent trace."""
|
| 125 |
try:
|
| 126 |
# In our mock, the verifier's output contains the final vector preview
|