ffreemt commited on
Commit
9726652
1 Parent(s): 7336f82

Update back to SimepleNamespace

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -3,9 +3,9 @@
3
  import os
4
  import time
5
  from dataclasses import asdict, dataclass
 
6
 
7
- # from types import SimpleNamespace
8
- from typing import Generator
9
 
10
  import gradio as gr
11
  from about_time import about_time
@@ -30,14 +30,13 @@ if MOSAICML_API_KEY is None:
30
  raise ValueError("git environment variable must be set")
31
 
32
 
33
- # ns = SimpleNamespace(
34
- @dataclass
35
- class Namespace:
36
- response: str = ""
37
- generator: Generator | list = []
38
-
39
-
40
- ns = Namespace()
41
 
42
 
43
  def predict0(prompt, bot):
 
3
  import os
4
  import time
5
  from dataclasses import asdict, dataclass
6
+ from types import SimpleNamespace
7
 
8
+ # from typing import Generator
 
9
 
10
  import gradio as gr
11
  from about_time import about_time
 
30
  raise ValueError("git environment variable must be set")
31
 
32
 
33
+ # @dataclass
34
+ # class Namespace:
35
+ # ns = Namespace()
36
+ ns = SimpleNamespace(
37
+ response="",
38
+ generator=[],
39
+ )
 
40
 
41
 
42
  def predict0(prompt, bot):