Skip to content

Commit

Permalink
Update demo light to match the change.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoyijia committed Jul 16, 2024
1 parent 03ace46 commit 16a6903
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion frontend/demo_light/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ This is a minimal user interface for `STORMWikiRunner` which includes the follow
</p>

## Setup
1. Besides the required packages for `STORMWikiRunner`, you need to install additional packages:
1. Make sure you have installed `knowledge-storm` or set up the source code correctly.
2. Install additional packages required by the user interface:
```bash
pip install -r requirements.txt
```
Expand Down
15 changes: 8 additions & 7 deletions frontend/demo_light/demo_util.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import base64
import datetime
import io
import json
import os
import re
from typing import Optional

import markdown
import pdfkit
import pytz
import streamlit as st
from lm import OpenAIModel
from rm import YouRM
from storm_wiki.engine import STORMWikiRunnerArguments, STORMWikiRunner, STORMWikiLMConfigs
from storm_wiki.modules.callback import BaseCallbackHandler

# If you install the source code instead of the `knowledge-storm` package,
# Uncomment the following lines:
# import sys
# sys.path.append('../../')
from knowledge_storm import STORMWikiRunnerArguments, STORMWikiRunner, STORMWikiLMConfigs
from knowledge_storm.lm import OpenAIModel
from knowledge_storm.rm import YouRM
from knowledge_storm.storm_wiki.modules.callback import BaseCallbackHandler
from stoc import stoc


Expand Down Expand Up @@ -529,7 +531,6 @@ def display_article_page(selected_article_name, selected_article_file_path_dict,
_display_main_article(selected_article_file_path_dict)



class StreamlitCallbackHandler(BaseCallbackHandler):
def __init__(self, status_container):
self.status_container = status_container
Expand Down
4 changes: 0 additions & 4 deletions frontend/demo_light/storm.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import os
import sys

script_dir = os.path.dirname(os.path.abspath(__file__))
wiki_root_dir = os.path.dirname(os.path.dirname(script_dir))

sys.path.append(os.path.normpath(os.path.join(script_dir, '../../src/storm_wiki')))
sys.path.append(os.path.normpath(os.path.join(script_dir, '../../src')))

import demo_util
from pages_util import MyArticles, CreateNewArticle
from streamlit_float import *
Expand Down

0 comments on commit 16a6903

Please sign in to comment.