Spaces:
Sleeping
Sleeping
Update common.py
Browse files
common.py
CHANGED
@@ -5,6 +5,11 @@ import numpy as np
|
|
5 |
import tiktoken
|
6 |
from langchain.text_splitter import TokenTextSplitter
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
def strtobool(val):
|
9 |
val = val.lower()
|
10 |
if val in ('yes', 'true', 't', '1'):
|
|
|
5 |
import tiktoken
|
6 |
from langchain.text_splitter import TokenTextSplitter
|
7 |
|
8 |
+
def strip_quotes(text):
|
9 |
+
if text.startswith('"') and text.endswith('"'):
|
10 |
+
return text[1:-1]
|
11 |
+
return text
|
12 |
+
|
13 |
def strtobool(val):
|
14 |
val = val.lower()
|
15 |
if val in ('yes', 'true', 't', '1'):
|