Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View calio's full-sized avatar

Jiale Zhi calio

  • San Francisco, US
View GitHub Profile
openai==1.6.1 and gunicorn gevent worker caused max stack depth error.
See also:
- https://www.cnblogs.com/buxizhizhoum/p/16264833.html
- https://blog.csdn.net/China_AT001/article/details/120354584
- https://luxrck.github.io/p/gevent-ssl-infinity-recursion-error/
- https://github.com/eventlet/eventlet/issues/618
Stack trace:
[2024-01-02 18:46:48 +0000] [3828971] [ERROR] Exception in worker process
[2023-08-07 03:01:13,415] ERROR in app: Exception on /api/get_example_answer [GET]
Traceback (most recent call last):
File "/home/web/venv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/home/web/venv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/web/venv/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/web/venv/lib/python3.10/site-packages/newrelic/hooks/framework_flask.py", line 148, in _nr_wrapper_Flask_handle_exception_
return FunctionTraceWrapper(wrapped, name=name)(*args, **kwargs)
payload [2023-07-18 21:43:53,776] ERROR in app: Exception on /api/payment_webhook [POST]
Traceback (most recent call last):
File "/home/web/venv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/home/web/venv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/web/venv/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/web/venv/lib/python3.10/site-packages/newrelic/hooks/framework_flask.py", line 148, in _nr_wrapper_Flask_handle_exception_
return FunctionTraceWrapper(wrapped, name=name)(*args, **kwargs)
9. Keywords
| Words | Phonetic Symbols | Parts of Speech | English definitions | Chinese translations | Sample sentences |
|-------|------------------|-----------------|---------------------|----------------------|------------------|
| Apprehension | /ˌæprɪˈhenʃən/ | Noun | Anxiety or fear that something bad will happen. | 担忧,忧虑 | Moving to a new country often brings with it a sense of apprehension. |
| Resilience | /rɪˈzɪliəns/ | Noun | The capacity to recover quickly from difficulties; toughness. | 韧性,恢复力 | Moving away from home fosters resilience as one learns to adapt to new situations. |
| Immersion |/ɪˈmɜːrʒən/| Noun | The action of immersing someone or something in a substance, liquid, or culture.| 沉浸,浸入法,全神贯注的学习法。| Living in Canada allowed for complete immersion in its diverse culture. |
| Constraints |/kənˈstreɪnts/| Noun | A limitation or restriction.| 约束,限制。| True friendships are not bound by geographical constraints. |
| Endeavor |/ɛn'devər/| Verb/Noun | Try hard to do or achieve something.| 努力,尽
import React, { useState, useEffect } from 'react';
import './App.css';
function App() {
const [content, setContent] = useState('');
useEffect(() => {
const eventSource = new EventSource('http://localhost:3001/sse');
eventSource.onmessage = (event) => {
@calio
calio / baselines_fiber.diff
Created February 22, 2020 00:10
OpenAI Baselines + Fiber
diff --git a/baselines/common/vec_env/subproc_vec_env.py b/baselines/common/vec_env/subproc_vec_env.py
index 8c74000..d0ea409 100644
--- a/baselines/common/vec_env/subproc_vec_env.py
+++ b/baselines/common/vec_env/subproc_vec_env.py
@@ -1,4 +1,4 @@
-import multiprocessing as mp
+import fiber as mp
import numpy as np
from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars
@calio
calio / cflow_allow_static_to_be_main.patch
Created December 23, 2015 18:52
Stock cflow doesn't allow static symbol to be main function using '-m' argument, this fixed that.
diff --git a/src/symbol.c b/src/symbol.c
index 567e458..2810540 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -131,6 +131,8 @@ install(char *name, int flags)
void
ident_change_storage(Symbol *sp, enum storage storage)
{
+ if (!strcmp(sp->name, start_name))
+ storage = ExternStorage;
@calio
calio / stp-r940.patch
Created August 13, 2015 19:16
stp-r940.patch solve stp building failure described here http://klee.github.io/getting-started/
diff -ur stp-r940-origin/src/parser/CVC.y stp-r940-patched/src/parser/CVC.y
--- stp-r940-origin/src/parser/CVC.y 2013-12-12 08:13:18.000000000 -0800
+++ stp-r940-patched/src/parser/CVC.y 2015-08-13 12:07:25.797199030 -0700
@@ -22,7 +22,6 @@
#define YYMAXDEPTH 1048576000
#define YYERROR_VERBOSE 1
#define YY_EXIT_FAILURE -1
-#define YYPARSE_PARAM AssertsQuery
extern int cvclex(void);
@calio
calio / r13644.patch
Last active August 29, 2015 14:22
Make valgrind >= 3.9 works with LuaJIT
Index: include/vki/vki-amd64-linux.h
===================================================================
--- include/vki/vki-amd64-linux.h (revision 13644)
+++ include/vki/vki-amd64-linux.h (revision 13643)
@@ -236,7 +236,6 @@
#define VKI_MAP_PRIVATE 0x02 /* Changes are private */
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
-#define VKI_MAP_32BIT 0x40 /* only give out 32bit addresses */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
@calio
calio / clock_gettime
Last active January 11, 2018 13:15
clock_gettime() via LuaJIT + FFI
local ffi = require("ffi")
ffi.cdef[[
typedef long time_t;
typedef int clockid_t;
typedef struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
} nanotime;