Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
|
2 |
# === Imports ===
|
3 |
import os
|
|
|
4 |
import re
|
5 |
import gradio as gr
|
6 |
import openai
|
@@ -18,6 +19,26 @@ client = openai.OpenAI(api_key=openai_api_key)
|
|
18 |
openrouter_key = os.environ.get("OPENROUTER")
|
19 |
openrouter = openai.OpenAI(api_key=openrouter_key, base_url="https://openrouter.ai/api/v1")
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# --- OCI Object Storage Setup ---
|
22 |
oci_config = {
|
23 |
"user": os.environ.get("OCI_USER"),
|
@@ -29,12 +50,14 @@ oci_config = {
|
|
29 |
|
30 |
namespace = os.environ.get("OCI_NAMESPACE")
|
31 |
bucket_name = os.environ.get("OCI_BUCKET_NAME")
|
|
|
|
|
32 |
|
33 |
try:
|
34 |
object_storage = oci.object_storage.ObjectStorageClient(oci_config)
|
35 |
except Exception as e:
|
36 |
print("Failed to initialize OCI Object Storage client:", e)
|
37 |
-
|
38 |
# --- Exadata Specs ---
|
39 |
exadata_specs = {
|
40 |
"X7": {"Quarter Rack": {"max_iops": 350000, "max_throughput": 25}, "Half Rack": {"max_iops": 700000, "max_throughput": 50}, "Full Rack": {"max_iops": 1400000, "max_throughput": 100}},
|
|
|
1 |
|
2 |
# === Imports ===
|
3 |
import os
|
4 |
+
import oci
|
5 |
import re
|
6 |
import gradio as gr
|
7 |
import openai
|
|
|
19 |
openrouter_key = os.environ.get("OPENROUTER")
|
20 |
openrouter = openai.OpenAI(api_key=openrouter_key, base_url="https://openrouter.ai/api/v1")
|
21 |
|
22 |
+
# --- OCI Object Storage: Explicit Fixed Configuration ---
|
23 |
+
|
24 |
+
oci_config = {
|
25 |
+
"user": "ocid1.user.oc1..aaaaaaaatiwkdcralqexwxw674imk7mevxrhz7tnyn6iljn5empw4k4gva3q",
|
26 |
+
"tenancy": "ocid1.tenancy.oc1..aaaaaaaaxtkkpxc5qwgpwx7y2wt5pinegyzea4uacnmck7iamsssjvw4s3bq",
|
27 |
+
"fingerprint": "b9:60:f9:d2:c8:6b:90:a6:81:0d:66:a3:6b:70:9d:d5",
|
28 |
+
"region": "us-ashburn-1",
|
29 |
+
|
30 |
+
# --- Fixed namespace and bucket name ---
|
31 |
+
namespace = "orasenatdpltdevopsnetw02"
|
32 |
+
bucket_name = "OracleTANGO"
|
33 |
+
|
34 |
+
# --- Instantiate the Object Storage client ---
|
35 |
+
try:
|
36 |
+
object_storage = oci.object_storage.ObjectStorageClient(oci_config)
|
37 |
+
print("✅ OCI Object Storage client initialized successfully.")
|
38 |
+
except Exception as e:
|
39 |
+
print("❌ Failed to initialize OCI Object Storage client:", e)
|
40 |
+
|
41 |
+
"""
|
42 |
# --- OCI Object Storage Setup ---
|
43 |
oci_config = {
|
44 |
"user": os.environ.get("OCI_USER"),
|
|
|
50 |
|
51 |
namespace = os.environ.get("OCI_NAMESPACE")
|
52 |
bucket_name = os.environ.get("OCI_BUCKET_NAME")
|
53 |
+
os.environ["OCI_BUCKET_NAME"] = "OracleTANGO"
|
54 |
+
|
55 |
|
56 |
try:
|
57 |
object_storage = oci.object_storage.ObjectStorageClient(oci_config)
|
58 |
except Exception as e:
|
59 |
print("Failed to initialize OCI Object Storage client:", e)
|
60 |
+
"""
|
61 |
# --- Exadata Specs ---
|
62 |
exadata_specs = {
|
63 |
"X7": {"Quarter Rack": {"max_iops": 350000, "max_throughput": 25}, "Half Rack": {"max_iops": 700000, "max_throughput": 50}, "Full Rack": {"max_iops": 1400000, "max_throughput": 100}},
|