Alex Cabrera commited on
Commit
13e89d2
·
1 Parent(s): 32a1543

demo of two zenos

Browse files
.zeno_cache/folders.pickle ADDED
@@ -0,0 +1 @@
 
 
1
+ �]�.
.zeno_cache/reports.pickle ADDED
Binary file (1.44 kB). View file
 
.zeno_cache/slices.pickle ADDED
Binary file (732 Bytes). View file
 
data/adult.csv ADDED
The diff for this file is too large to render. See raw diff
 
poetry.lock CHANGED
The diff for this file is too large to render. See raw diff
 
pyproject.toml CHANGED
@@ -6,7 +6,8 @@ authors = ["Alex Cabrera <alex.cabrera@gmail.com>"]
6
  readme = "README.md"
7
 
8
  [tool.poetry.dependencies]
9
- python = "^3.8.1"
 
10
  fastapi = "^0.95.0"
11
  uvicorn = "^0.21.1"
12
 
 
6
  readme = "README.md"
7
 
8
  [tool.poetry.dependencies]
9
+ zenoml = "^0.4.7"
10
+ python = "^3.8.1,<=3.11"
11
  fastapi = "^0.95.0"
12
  uvicorn = "^0.21.1"
13
 
zeno-evals-hub/main.py CHANGED
@@ -1,19 +1,13 @@
1
  import os
 
 
 
2
 
3
  import uvicorn
4
  from fastapi import FastAPI
5
  from fastapi.staticfiles import StaticFiles
6
 
7
- # from zeno import get_server, zeno
8
-
9
- # create zeno object
10
- # create second zeno object
11
-
12
- # create fastapi for both zeno objects
13
-
14
- # serve
15
-
16
- # get_server()
17
 
18
 
19
  def command_line():
@@ -24,6 +18,27 @@ def command_line():
24
  def test():
25
  return {"test": "test"}
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  app.mount("/api", api_app)
28
 
29
  app.mount(
@@ -36,8 +51,10 @@ def command_line():
36
  )
37
 
38
  print("Running server")
39
- uvicorn.run(app, host="0.0.0.0", port=int(os.getenv("PORT")))
40
 
 
 
 
 
41
 
42
- if __name__ == "__main__":
43
- command_line()
 
1
  import os
2
+ import sys
3
+
4
+ import pandas as pd
5
 
6
  import uvicorn
7
  from fastapi import FastAPI
8
  from fastapi.staticfiles import StaticFiles
9
 
10
+ from zeno import get_server, zeno, ZenoParameters # type: ignore
 
 
 
 
 
 
 
 
 
11
 
12
 
13
  def command_line():
 
18
  def test():
19
  return {"test": "test"}
20
 
21
+ # from zeno import get_server, zeno
22
+
23
+ df = pd.read_csv("./data/adult.csv")
24
+
25
+ configA = ZenoParameters(metadata=df.head(10), serve=False)
26
+ configB = ZenoParameters(metadata=df.head(100), serve=False)
27
+
28
+ zenoA = zeno(configA)
29
+ if zenoA is None:
30
+ sys.exit(1)
31
+ serverA = get_server(zenoA)
32
+ zenoA.start_processing()
33
+ app.mount("/zenoA", serverA)
34
+
35
+ zenoB = zeno(configB)
36
+ if zenoB is None:
37
+ sys.exit(1)
38
+ serverB = get_server(zenoB)
39
+ zenoB.start_processing()
40
+ app.mount("/zenoB", serverB)
41
+
42
  app.mount("/api", api_app)
43
 
44
  app.mount(
 
51
  )
52
 
53
  print("Running server")
 
54
 
55
+ port = 8000
56
+ port_arg = os.getenv("PORT")
57
+ if port_arg is not None:
58
+ port = int(port_arg)
59
 
60
+ uvicorn.run(app, host="localhost", port=port)