:wrench: revert to a different model each day.
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import gradio as gr
|
|
3 |
import os
|
4 |
import json
|
5 |
import html
|
|
|
|
|
6 |
|
7 |
api_key = os.environ.get('FEATHERLESS_API_KEY')
|
8 |
|
@@ -96,7 +98,10 @@ def build_model_choices():
|
|
96 |
|
97 |
model_choices = build_model_choices()
|
98 |
|
99 |
-
|
|
|
|
|
|
|
100 |
# this doesn't work in HF spaces because we're iframed :(
|
101 |
# def initial_model(referer=None):
|
102 |
# return REFLECTION
|
|
|
3 |
import os
|
4 |
import json
|
5 |
import html
|
6 |
+
import random
|
7 |
+
import datetime
|
8 |
|
9 |
api_key = os.environ.get('FEATHERLESS_API_KEY')
|
10 |
|
|
|
98 |
|
99 |
model_choices = build_model_choices()
|
100 |
|
101 |
+
# let's use a random but different model each day.
|
102 |
+
key=os.environ.get('RANDOM_SEED', 'kcOtfNHA+e')
|
103 |
+
o = random.Random(f"{key}-{datetime.date.today().strftime('%Y-%m-%d')}")
|
104 |
+
initial_model = o.choice(model_choices)[1]
|
105 |
# this doesn't work in HF spaces because we're iframed :(
|
106 |
# def initial_model(referer=None):
|
107 |
# return REFLECTION
|