Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,23 +3,15 @@
|
|
| 3 |
#huggingface-projects/llama-2-7b-chat
|
| 4 |
import re # for cutting <ref> links out of Wi
|
| 5 |
import gradio as gr
|
| 6 |
-
import openai # for calling the OpenAI API
|
| 7 |
import tiktoken # for counting tokens
|
| 8 |
import urllib.parse
|
| 9 |
import pyperclip
|
| 10 |
import os
|
| 11 |
-
#from langchain.chat_models import ChatOpenAI
|
| 12 |
import pandas as pd
|
| 13 |
|
| 14 |
-
#La key está guardad en las variables de entorno del Mac
|
| 15 |
-
openai.api_key = os.getenv('OPENAI_API_KEY')
|
| 16 |
-
openai.api_key = "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"
|
| 17 |
-
|
| 18 |
#Modelo por defecto
|
| 19 |
-
GPT_MODEL = "
|
| 20 |
|
| 21 |
-
# Funciones
|
| 22 |
-
#openai.api_key = "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"
|
| 23 |
|
| 24 |
def num_tokens(text: str, model: str = GPT_MODEL) -> int:
|
| 25 |
"""Return the number of tokens in a string."""
|
|
|
|
| 3 |
#huggingface-projects/llama-2-7b-chat
|
| 4 |
import re # for cutting <ref> links out of Wi
|
| 5 |
import gradio as gr
|
|
|
|
| 6 |
import tiktoken # for counting tokens
|
| 7 |
import urllib.parse
|
| 8 |
import pyperclip
|
| 9 |
import os
|
|
|
|
| 10 |
import pandas as pd
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
#Modelo por defecto
|
| 13 |
+
GPT_MODEL = ""
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
def num_tokens(text: str, model: str = GPT_MODEL) -> int:
|
| 17 |
"""Return the number of tokens in a string."""
|