anvil callable missing
Browse files- app.py +3 -0
- library.ipynb +0 -20
app.py
CHANGED
@@ -19,6 +19,9 @@ MESSAGED={'title':'API Server',
|
|
19 |
tokenizer = AutoTokenizer.from_pretrained('allenai/specter')
|
20 |
encoder = AutoModel.from_pretrained('allenai/specter')
|
21 |
|
|
|
|
|
|
|
22 |
service=BackgroundTaskService(max_tasks=10)
|
23 |
service.register(call_gpt)
|
24 |
service.register(call_gemini)
|
|
|
19 |
tokenizer = AutoTokenizer.from_pretrained('allenai/specter')
|
20 |
encoder = AutoModel.from_pretrained('allenai/specter')
|
21 |
|
22 |
+
anvil.server.callable(call_gpt)
|
23 |
+
anvil.server.callable(call_gemini)
|
24 |
+
|
25 |
service=BackgroundTaskService(max_tasks=10)
|
26 |
service.register(call_gpt)
|
27 |
service.register(call_gemini)
|
library.ipynb
CHANGED
@@ -34,26 +34,6 @@
|
|
34 |
" return 0,retval"
|
35 |
]
|
36 |
},
|
37 |
-
{
|
38 |
-
"cell_type": "code",
|
39 |
-
"execution_count": null,
|
40 |
-
"metadata": {},
|
41 |
-
"outputs": [],
|
42 |
-
"source": [
|
43 |
-
"# def call_gemini(text,key):\n",
|
44 |
-
"# # response=f'calling gemini with key {key} and text {text}'\n",
|
45 |
-
"# # return response\n",
|
46 |
-
"# genai.configure(api_key=key)\n",
|
47 |
-
"# model = genai.GenerativeModel('gemini-pro')\n",
|
48 |
-
"# try:\n",
|
49 |
-
"# response = model.generate_content(text)\n",
|
50 |
-
"# except Exception as e:\n",
|
51 |
-
"# return -1,str(e)\n",
|
52 |
-
"# if 'text' in response.__dict__ :\n",
|
53 |
-
"# return 0,response.text\n",
|
54 |
-
"# else: return -1,'no generation'"
|
55 |
-
]
|
56 |
-
},
|
57 |
{
|
58 |
"cell_type": "code",
|
59 |
"execution_count": null,
|
|
|
34 |
" return 0,retval"
|
35 |
]
|
36 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
{
|
38 |
"cell_type": "code",
|
39 |
"execution_count": null,
|